opencastle 0.32.12 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -93
- package/README.md +5 -3
- package/package.json +2 -2
- package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
- package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
- package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +12 -12
- package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
- package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
- package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
- package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
- package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
- package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +12 -12
- package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
- package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
- package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
- package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
- package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
- package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
- package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
- package/src/orchestrator/plugins/astro/SKILL.md +22 -29
- package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
- package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
- package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
- package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/convex/SKILL.md +13 -1
- package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
- package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
- package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
- package/src/orchestrator/plugins/figma/SKILL.md +41 -66
- package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/jira/SKILL.md +26 -114
- package/src/orchestrator/plugins/linear/SKILL.md +42 -109
- package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
- package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
- package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
- package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
- package/src/orchestrator/plugins/notion/SKILL.md +26 -168
- package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
- package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
- package/src/orchestrator/plugins/nx/SKILL.md +12 -12
- package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
- package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
- package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
- package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
- package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
- package/src/orchestrator/plugins/resend/SKILL.md +23 -137
- package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
- package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
- package/src/orchestrator/plugins/slack/SKILL.md +36 -111
- package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
- package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
- package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
- package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
- package/src/orchestrator/plugins/teams/SKILL.md +35 -85
- package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/trello/SKILL.md +25 -97
- package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
- package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
- package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
- package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
- package/src/orchestrator/prompts/generate-convoy.prompt.md +6 -0
- package/src/orchestrator/prompts/generate-prd.prompt.md +4 -0
- package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
- package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
- package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
- package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
- package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
- package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +16 -0
- package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +99 -0
- package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
- package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
- package/src/orchestrator/skills/context-map/SKILL.md +28 -55
- package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
- package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
- package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
- package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
- package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
- package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
- package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
- package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
- package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
- package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
- package/src/orchestrator/skills/git-workflow/SKILL.md +13 -2
- package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
- package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
- package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
- package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
- package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
- package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
- package/src/orchestrator/skills/react-development/SKILL.md +50 -42
- package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
- package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
- package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
- package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
- package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
- package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
|
@@ -1,170 +1,81 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nextjs-framework
|
|
3
|
-
description: "
|
|
3
|
+
description: "Explains how to configure App Router, implement server/client components, optimize data fetching, and secure routes. Use when the user mentions: 'add an authenticated route', 'migrate to App Router', 'optimize fetch caching', or 'fix RSC hydration'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
7
|
|
|
8
8
|
# Next.js Framework
|
|
9
9
|
|
|
10
|
-
## Project Structure
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
├── app/ # App Router (file-based routing)
|
|
14
|
-
│ ├── layout.tsx # Root layout (required)
|
|
15
|
-
│ ├── page.tsx # Home route → /
|
|
16
|
-
│ ├── loading.tsx # Loading UI (Suspense boundary)
|
|
17
|
-
│ ├── error.tsx # Error boundary (Client Component)
|
|
18
|
-
│ ├── not-found.tsx # 404 page
|
|
19
|
-
│ ├── (marketing)/ # Route group (no URL segment)
|
|
20
|
-
│ │ └── about/page.tsx # → /about
|
|
21
|
-
│ ├── dashboard/
|
|
22
|
-
│ │ ├── layout.tsx # Nested layout
|
|
23
|
-
│ │ └── [id]/page.tsx # → /dashboard/:id
|
|
24
|
-
│ └── api/
|
|
25
|
-
│ └── users/route.ts # API route handler
|
|
26
|
-
├── components/ # Shared React components
|
|
27
|
-
├── lib/ # Utilities, helpers, server logic
|
|
28
|
-
├── public/ # Static assets
|
|
29
|
-
├── next.config.ts # Next.js configuration
|
|
30
|
-
├── middleware.ts # Edge middleware
|
|
31
|
-
└── .env.local # Environment variables (not committed)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Route Groups `(name)` organize routes without affecting the URL. Private Folders `_internal` opt out of routing. Parallel Routes `@modal` render multiple pages in the same layout.
|
|
35
|
-
|
|
36
|
-
## Rendering Strategies
|
|
37
|
-
|
|
38
|
-
| Strategy | When | How |
|
|
39
|
-
|----------|------|-----|
|
|
40
|
-
| **Static (SSG)** | Build time | Default for pages with no dynamic data |
|
|
41
|
-
| **ISR** | Build + revalidation | `fetch` with `next: { revalidate: N }` or route segment config |
|
|
42
|
-
| **SSR** | Every request | `export const dynamic = 'force-dynamic'` or dynamic functions |
|
|
43
|
-
| **CSR** | Browser | `'use client'` components with `useEffect`/SWR |
|
|
44
|
-
| **Streaming** | Progressive | `<Suspense>` boundaries + `loading.tsx` |
|
|
45
|
-
| **PPR** | Build + streaming | Static shell with dynamic holes via `<Suspense>` |
|
|
46
|
-
|
|
47
|
-
Route segment config: `export const dynamic = 'force-dynamic'`, `export const revalidate = 60`, `export const runtime = 'edge'`.
|
|
48
|
-
|
|
49
|
-
## Server and Client Components
|
|
50
|
-
|
|
51
|
-
**Default: Server Components** — data fetching, heavy logic, non-interactive UI.
|
|
52
|
-
**Client Components** — add `'use client'` at top. Use for interactivity, state, browser APIs.
|
|
53
|
-
|
|
54
|
-
| Need | Component Type |
|
|
55
|
-
|------|---------------|
|
|
56
|
-
| Fetch data / read cookies/headers | Server |
|
|
57
|
-
| Interactive UI (clicks, inputs) | Client |
|
|
58
|
-
| `useState` / `useEffect` / browser APIs | Client |
|
|
59
|
-
| Static/non-interactive content | Server |
|
|
60
|
-
| Async children with loading state | Server + `<Suspense>` |
|
|
61
|
-
|
|
62
10
|
### Critical Rule
|
|
63
11
|
|
|
64
|
-
**Never use `next/dynamic` with `{ ssr: false }` inside a Server Component.** Extract to a dedicated `'use client'` component and import it normally.
|
|
12
|
+
**Never use `next/dynamic` with `{ ssr: false }` inside a Server Component.** Extract the dynamic piece to a dedicated `'use client'` component and import it from server components normally.
|
|
65
13
|
|
|
66
|
-
|
|
14
|
+
```tsx
|
|
15
|
+
// ✅ Correct: wrap dynamic import in a 'use client' component
|
|
16
|
+
// components/MapClient.tsx
|
|
17
|
+
'use client';
|
|
18
|
+
import dynamic from 'next/dynamic';
|
|
19
|
+
const Map = dynamic(() => import('./Map'), { ssr: false });
|
|
20
|
+
export function MapClient(props: MapProps) { return <Map {...props} />; }
|
|
21
|
+
|
|
22
|
+
// Then import from a Server Component as normal:
|
|
23
|
+
// app/page.tsx
|
|
24
|
+
import { MapClient } from '@/components/MapClient';
|
|
25
|
+
export default function Page() { return <MapClient center={[0, 0]} />; }
|
|
26
|
+
```
|
|
67
27
|
|
|
68
|
-
###
|
|
28
|
+
### Authenticated Routes
|
|
69
29
|
|
|
70
30
|
```tsx
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
31
|
+
// app/dashboard/page.tsx
|
|
32
|
+
import { redirect } from 'next/navigation';
|
|
33
|
+
import { getSession } from '@/lib/auth';
|
|
34
|
+
export default async function Page() {
|
|
35
|
+
const session = await getSession();
|
|
36
|
+
if (!session) redirect('/login');
|
|
37
|
+
// ... render dashboard
|
|
74
38
|
}
|
|
75
39
|
```
|
|
76
40
|
|
|
41
|
+
For middleware-based protection see `REFERENCE.md § Middleware examples`.
|
|
42
|
+
|
|
77
43
|
### Server Actions
|
|
78
44
|
|
|
79
|
-
```
|
|
45
|
+
```ts
|
|
46
|
+
// app/actions.ts
|
|
80
47
|
'use server';
|
|
81
48
|
import { revalidatePath } from 'next/cache';
|
|
82
|
-
export async function
|
|
83
|
-
await db.
|
|
84
|
-
revalidatePath('/
|
|
49
|
+
export async function updatePost(id: string, data: FormData) {
|
|
50
|
+
await db.posts.update(id, Object.fromEntries(data));
|
|
51
|
+
revalidatePath('/posts');
|
|
85
52
|
}
|
|
86
53
|
```
|
|
87
54
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
### Parallel Fetching
|
|
91
|
-
|
|
92
|
-
```tsx
|
|
93
|
-
const [metrics, activity] = await Promise.all([getMetrics(), getRecentActivity()]);
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Caching
|
|
97
|
-
|
|
98
|
-
| Mechanism | Scope | How to Use |
|
|
99
|
-
|-----------|-------|------------|
|
|
100
|
-
| **Request Memoization** | Per-request | Automatic deduplication of identical `fetch` calls |
|
|
101
|
-
| **Data Cache** | Cross-request | Cached by default; opt out with `cache: 'no-store'` |
|
|
102
|
-
| **Full Route Cache** | Build time | Static routes cached as HTML + RSC payload |
|
|
103
|
-
| **Router Cache** | Client-side | Prefetched and visited routes cached in browser |
|
|
104
|
-
|
|
105
|
-
On-demand revalidation: `revalidatePath('/blog')` or `revalidateTag('posts')`. Tag a fetch: `fetch(url, { next: { tags: ['posts'] } })`.
|
|
106
|
-
|
|
107
|
-
## Routing
|
|
108
|
-
|
|
109
|
-
### File Conventions
|
|
110
|
-
|
|
111
|
-
| File | Purpose |
|
|
112
|
-
|------|---------|
|
|
113
|
-
| `page.tsx` | Route UI |
|
|
114
|
-
| `layout.tsx` | Shared layout (persists across navigation) |
|
|
115
|
-
| `template.tsx` | Like layout but re-mounts on navigation |
|
|
116
|
-
| `loading.tsx` | Loading UI (automatic Suspense boundary) |
|
|
117
|
-
| `error.tsx` | Error UI (Client Component) |
|
|
118
|
-
| `not-found.tsx` | 404 UI |
|
|
119
|
-
| `route.ts` | API endpoint |
|
|
120
|
-
| `default.tsx` | Fallback for parallel routes |
|
|
121
|
-
|
|
122
|
-
### Dynamic Routes
|
|
123
|
-
|
|
124
|
-
- `app/blog/[slug]/page.tsx` → `/blog/:slug`
|
|
125
|
-
- `app/shop/[...slug]/page.tsx` → `/shop/:slug+` (catch-all)
|
|
126
|
-
- `app/shop/[[...slug]]/page.tsx` → `/shop` or `/shop/:slug+` (optional)
|
|
127
|
-
|
|
128
|
-
## Middleware
|
|
129
|
-
|
|
130
|
-
Runs at the Edge before every matched request. Use for auth, redirects, rewrites.
|
|
55
|
+
### Data Fetching & Caching
|
|
131
56
|
|
|
132
57
|
```ts
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return NextResponse.next();
|
|
58
|
+
// Server Component — cached by default; opt out with cache: 'no-store'
|
|
59
|
+
async function getPosts() {
|
|
60
|
+
const res = await fetch('/api/posts', { next: { tags: ['posts'] } });
|
|
61
|
+
return res.json() as Promise<Post[]>;
|
|
138
62
|
}
|
|
139
|
-
|
|
63
|
+
// On-demand revalidation: revalidateTag('posts') or revalidatePath('/posts')
|
|
140
64
|
```
|
|
141
65
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
| Prefix | Available in | Use Case |
|
|
145
|
-
|--------|-------------|----------|
|
|
146
|
-
| `NEXT_PUBLIC_` | Server + Client | Public values (API base URLs, feature flags) |
|
|
147
|
-
| No prefix | Server only | Secrets (DB URLs, API keys, tokens) |
|
|
148
|
-
|
|
149
|
-
Files (priority order): `.env.local`, `.env.development` / `.env.production`, `.env`.
|
|
150
|
-
|
|
151
|
-
## Image, Font, and Metadata
|
|
66
|
+
Caching tiers (request memo → data cache → full route cache → router cache) and revalidation patterns are in `REFERENCE.md § Caching Details`.
|
|
152
67
|
|
|
153
|
-
|
|
154
|
-
- **Fonts**: Use `next/font/google` — zero layout shift, self-hosted, no external network request.
|
|
155
|
-
- **Metadata**: Export `metadata` (static) or `generateMetadata` (dynamic) per page/layout for SEO and social previews.
|
|
68
|
+
### Adding an Authenticated Route — Checklist
|
|
156
69
|
|
|
157
|
-
|
|
70
|
+
1. Create `app/<route>/page.tsx` as an async Server Component.
|
|
71
|
+
- Validate: file exists and exports a default async component.
|
|
72
|
+
2. Call `getSession()` at the top and `redirect('/login')` when missing.
|
|
73
|
+
- Validate: confirm there is no render path when session is falsy (no UI returned before redirect).
|
|
74
|
+
3. Add `app/<route>/error.tsx` for error boundaries.
|
|
75
|
+
- Validate: `tsc --noEmit` recognizes the file and there are no missing imports.
|
|
76
|
+
4. Run `tsc --noEmit` and fix type errors.
|
|
77
|
+
- Validate: `tsc --noEmit` exits with code 0.
|
|
78
|
+
5. Test: access the route without an auth cookie and confirm redirect to `/login`.
|
|
79
|
+
- Validate: an unauthenticated HTTP request receives a 302/307 redirect to `/login`.
|
|
158
80
|
|
|
159
|
-
|
|
160
|
-
|-------------|---------------|-----------------|
|
|
161
|
-
| `'use client'` on every component | Bloats JS bundle, defeats RSC benefits | Default to Server Components |
|
|
162
|
-
| Sequential `await` for independent data | Waterfall, slows page load | Use `Promise.all()` |
|
|
163
|
-
| `next/dynamic` with `ssr: false` in Server Components | Build/runtime crash | Extract to Client Component |
|
|
164
|
-
| Fetching in `useEffect` when server fetch works | Extra roundtrip, loading flash | Fetch in Server Component or Server Actions |
|
|
165
|
-
| Giant `layout.tsx` with all providers | Hard to test, couples concerns | Split into a `Providers` Client Component |
|
|
166
|
-
| No `error.tsx` per segment | Unhandled errors crash the page | Add `error.tsx` per route segment |
|
|
167
|
-
| Hardcoding secrets in source | Security risk, version control leak | Use `.env.local` and `process.env` |
|
|
168
|
-
| Skipping `loading.tsx` / `<Suspense>` | Blank screen while data loads | Add `loading.tsx` or wrap in `<Suspense>` |
|
|
169
|
-
| `getServerSideProps` / `getStaticProps` | Legacy Pages Router | Use App Router with async Server Components |
|
|
170
|
-
| Missing `metadata` exports | Poor SEO, no social previews | Export `metadata` or `generateMetadata` per page |
|
|
81
|
+
Project-specific conventions and deeper tables (routing, caching, component guidance) live in [REFERENCE.md](./REFERENCE.md).
|
|
@@ -1,205 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: notion-knowledge-management
|
|
3
|
-
description: "Notion
|
|
3
|
+
description: "Creates Notion pages and databases, applies templates for research docs, ADRs, and specs, and manages team knowledge bases. Use when creating Notion pages, structuring databases, documenting decisions, or capturing research findings."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
7
|
|
|
8
8
|
# Knowledge Management with Notion
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## MCP Server
|
|
13
|
-
|
|
14
|
-
| Field | Value |
|
|
15
|
-
|-------|-------|
|
|
16
|
-
| **Endpoint** | `https://mcp.notion.com/mcp` (HTTP, remote) |
|
|
17
|
-
| **Auth** | OAuth — users authenticate via Notion account when the MCP connection is established |
|
|
18
|
-
| **Type** | HTTP MCP (no local process to spawn) |
|
|
19
|
-
|
|
20
|
-
### Authentication
|
|
21
|
-
|
|
22
|
-
The Notion MCP server uses OAuth. When the MCP connection is first opened in your IDE, you will be prompted to authorise access to your Notion workspace. No API key or token is required in `.env`.
|
|
23
|
-
|
|
24
|
-
> **Scope:** The integration is granted access only to pages and databases explicitly shared with it. Before using MCP tools, ensure the relevant pages/databases are shared with the OpenCastle integration in Notion.
|
|
25
|
-
|
|
26
|
-
## Available MCP Tools
|
|
27
|
-
|
|
28
|
-
| Tool | Description |
|
|
29
|
-
|------|-------------|
|
|
30
|
-
| `search` | Search pages and databases across the workspace by keyword |
|
|
31
|
-
| `create_page` | Create a new page (standalone or inside a parent page/database) |
|
|
32
|
-
| `update_page` | Update page properties or archive a page |
|
|
33
|
-
| `append_block_children` | Append content blocks (paragraphs, headings, bullets, code) to a page |
|
|
34
|
-
| `query_database` | Query a Notion database with filters and sorts |
|
|
10
|
+
MCP endpoint: `https://mcp.notion.com/mcp` (OAuth). Tools: `search`, `create_page`, `update_page`, `append_block_children`, `query_database`.
|
|
35
11
|
|
|
36
12
|
## Working with Pages and Databases
|
|
37
13
|
|
|
38
|
-
### Page Hierarchy
|
|
14
|
+
### Page Hierarchy
|
|
39
15
|
|
|
40
|
-
|
|
16
|
+
Use `search` first to check if a page already exists. Place new pages under the appropriate parent (e.g., Engineering/Specs).
|
|
41
17
|
|
|
42
|
-
|
|
43
|
-
Workspace root
|
|
44
|
-
├── Engineering/
|
|
45
|
-
│ ├── Architecture Decisions/ ← ADRs go here
|
|
46
|
-
│ ├── Specs/ ← Feature specs go here
|
|
47
|
-
│ └── Research/ ← Research notes go here
|
|
48
|
-
├── Team/
|
|
49
|
-
│ ├── Meeting Notes/ ← Meeting intelligence
|
|
50
|
-
│ └── Decisions Log/ ← Key team decisions
|
|
51
|
-
└── Project: <name>/ ← Per-project space
|
|
52
|
-
├── Roadmap
|
|
53
|
-
├── Known Issues
|
|
54
|
-
└── Release Notes/
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
- Always use `search` first to check if a page already exists before creating a new one.
|
|
58
|
-
- Create pages as children of the appropriate parent — never at the workspace root unless explicitly requested.
|
|
59
|
-
- Use databases (not flat pages) for collections that need filtering, sorting, or status tracking (e.g., ADRs, specs).
|
|
18
|
+
### Create & verify page (end-to-end)
|
|
60
19
|
|
|
61
|
-
|
|
20
|
+
1. `search` for parent page (by title) to obtain `page_id`.
|
|
62
21
|
|
|
63
|
-
|
|
22
|
+
```json
|
|
23
|
+
// tool: notion/search
|
|
24
|
+
{ "query": "Engineering/Specs", "page_size": 5 }
|
|
25
|
+
// response.example: { results: [{ id: "abc123", title: "Engineering/Specs" }] }
|
|
26
|
+
```
|
|
64
27
|
|
|
65
|
-
|
|
66
|
-
2. `create_page` with `parent` set to the correct parent page or database
|
|
67
|
-
3. `append_block_children` to add structured content
|
|
28
|
+
2. `create_page` using the found `page_id` as `parent`.
|
|
68
29
|
|
|
69
30
|
```json
|
|
70
|
-
//
|
|
31
|
+
// tool: notion/create_page
|
|
71
32
|
{
|
|
72
|
-
"parent": { "page_id": "
|
|
73
|
-
"properties": {
|
|
74
|
-
"title": [{ "type": "text", "text": { "content": "[Spec] Price Range Filter" } }]
|
|
75
|
-
}
|
|
33
|
+
"parent": { "page_id": "abc123" },
|
|
34
|
+
"properties": { "title": [{ "type": "text", "text": { "content": "[Spec] Price Range Filter" } }] }
|
|
76
35
|
}
|
|
77
36
|
```
|
|
78
37
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Research Note Structure
|
|
82
|
-
|
|
83
|
-
Use this outline when capturing research findings:
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
# [Research] <Topic>
|
|
87
|
-
|
|
88
|
-
## Summary
|
|
89
|
-
One-paragraph overview of findings.
|
|
90
|
-
|
|
91
|
-
## Sources
|
|
92
|
-
- <URL or reference> — <why it is relevant>
|
|
93
|
-
|
|
94
|
-
## Key Findings
|
|
95
|
-
- Finding 1
|
|
96
|
-
- Finding 2
|
|
97
|
-
|
|
98
|
-
## Implications
|
|
99
|
-
How these findings affect the current task or architecture.
|
|
100
|
-
|
|
101
|
-
## Open Questions
|
|
102
|
-
- Question 1
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Architectural Decision Record (ADR) Structure
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
# ADR-NNN: <Short title>
|
|
109
|
-
|
|
110
|
-
**Status:** Proposed | Accepted | Deprecated | Superseded
|
|
111
|
-
**Date:** YYYY-MM-DD
|
|
112
|
-
|
|
113
|
-
## Context
|
|
114
|
-
What is the problem or decision to be made?
|
|
115
|
-
|
|
116
|
-
## Decision
|
|
117
|
-
What was decided?
|
|
118
|
-
|
|
119
|
-
## Consequences
|
|
120
|
-
What tradeoffs or follow-on work does this create?
|
|
121
|
-
|
|
122
|
-
## Alternatives Considered
|
|
123
|
-
- Option A — why rejected
|
|
124
|
-
- Option B — why rejected
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Spec-to-Implementation Link
|
|
128
|
-
|
|
129
|
-
When a spec page drives implementation, add an **Implementation** section at the bottom:
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
## Implementation
|
|
133
|
-
- **Branch:** `feat/price-range-filter`
|
|
134
|
-
- **PR:** <link>
|
|
135
|
-
- **Tracker:** <Linear/Jira/Trello card link>
|
|
136
|
-
- **Status:** In Progress / Done
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
This closes the loop between the knowledge base and the task tracker.
|
|
140
|
-
|
|
141
|
-
## Meeting Intelligence
|
|
142
|
-
|
|
143
|
-
When capturing meeting notes, use the following structure:
|
|
38
|
+
3. Verify creation by searching for the exact title and confirming `parent` matches.
|
|
144
39
|
|
|
40
|
+
```json
|
|
41
|
+
// tool: notion/search
|
|
42
|
+
{ "query": "[Spec] Price Range Filter" }
|
|
145
43
|
```
|
|
146
|
-
# Meeting: <Title> — YYYY-MM-DD
|
|
147
|
-
|
|
148
|
-
**Attendees:** Name1, Name2
|
|
149
|
-
**Type:** Planning / Review / Retrospective / Decision
|
|
150
|
-
|
|
151
|
-
## Summary
|
|
152
44
|
|
|
153
|
-
|
|
154
|
-
- Decision 1 (owner: Name)
|
|
45
|
+
Recovery: if search returns empty, retry after 30s (indexing delay) or confirm integration access.
|
|
155
46
|
|
|
156
|
-
##
|
|
157
|
-
- [ ] Action item (owner: Name, due: YYYY-MM-DD)
|
|
47
|
+
## Capturing Research and Decisions
|
|
158
48
|
|
|
159
|
-
|
|
160
|
-
```
|
|
49
|
+
Use the templates in [TEMPLATES.md](TEMPLATES.md) for Research Notes, ADRs, Specs, and Meeting notes. Create pages using the end-to-end pattern above and append implementation links to close the loop between spec and code.
|
|
161
50
|
|
|
162
|
-
|
|
51
|
+
Meeting notes: use [TEMPLATES.md](TEMPLATES.md) and append action items to the tracker (Linear/GitHub) with links.
|
|
163
52
|
|
|
164
53
|
## Permission-Aware Workflows
|
|
165
54
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
1. **Before writing** — run `search` to verify you can see the target page. If it does not appear, the integration has not been granted access.
|
|
169
|
-
2. **Sharing** — ask the user to share the relevant page or database with the OpenCastle integration before running MCP tools against it.
|
|
170
|
-
3. **Databases vs pages** — use `query_database` only on pages that are databases. Use `append_block_children` to add content to regular pages.
|
|
171
|
-
4. **Archived pages** — `search` does not return archived pages. If a page is missing, it may have been archived. Ask the user to restore it.
|
|
55
|
+
`search` the target parent first to confirm integration visibility. If missing, request user share the parent page. Use `query_database` for databases; `append_block_children` for regular pages.
|
|
172
56
|
|
|
173
57
|
## Database Query Patterns
|
|
174
58
|
|
|
175
|
-
### Filter by Status
|
|
176
|
-
|
|
177
|
-
```json
|
|
178
|
-
{
|
|
179
|
-
"filter": {
|
|
180
|
-
"property": "Status",
|
|
181
|
-
"select": { "equals": "In Progress" }
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Sort by Last Edited
|
|
187
|
-
|
|
188
59
|
```json
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
{ "timestamp": "last_edited_time", "direction": "descending" }
|
|
192
|
-
]
|
|
193
|
-
}
|
|
60
|
+
// tool: notion/query_database
|
|
61
|
+
{ "database_id": "db_id", "filter": { "property": "Status", "select": { "equals": "In Progress" } }, "sorts": [{ "timestamp": "last_edited_time", "direction": "descending" }] }
|
|
194
62
|
```
|
|
195
63
|
|
|
196
|
-
## Agent Usage Guidelines
|
|
197
|
-
|
|
198
|
-
| Agent | Primary Use |
|
|
199
|
-
|-------|-------------|
|
|
200
|
-
| **Team Lead** | Create spec pages, capture decisions, link tracker issues to specs |
|
|
201
|
-
| **Researcher** | Capture research notes, query databases for prior art, document findings |
|
|
202
|
-
| **Documentation Writer** | Write and update documentation pages, maintain page hierarchy |
|
|
203
|
-
| **Architect** | Write ADRs, create technical specs, link specs to implementation PRs |
|
|
204
|
-
|
|
205
|
-
**Never** delete pages via MCP — use `update_page` with `archived: true` if a page needs to be removed, and confirm with the user first.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
# Notion Templates (TEMPLATES.md)
|
|
4
|
+
|
|
5
|
+
Last Updated: 2026-03-31
|
|
6
|
+
|
|
7
|
+
## Research Note
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
# [Research] <Topic>
|
|
11
|
+
|
|
12
|
+
## Summary
|
|
13
|
+
One-paragraph overview of findings.
|
|
14
|
+
|
|
15
|
+
## Sources
|
|
16
|
+
- <URL or reference> — <why it is relevant>
|
|
17
|
+
|
|
18
|
+
## Key Findings
|
|
19
|
+
- Finding 1
|
|
20
|
+
- Finding 2
|
|
21
|
+
|
|
22
|
+
## Implications
|
|
23
|
+
How these findings affect the current task or architecture.
|
|
24
|
+
|
|
25
|
+
## Open Questions
|
|
26
|
+
- Question 1
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ADR (Architectural Decision Record)
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
## ADR-NNN: <Short title>
|
|
33
|
+
**Status:** Proposed | Accepted | Deprecated | Superseded
|
|
34
|
+
**Date:** YYYY-MM-DD
|
|
35
|
+
|
|
36
|
+
### Context
|
|
37
|
+
What is the problem or decision to be made?
|
|
38
|
+
|
|
39
|
+
### Decision
|
|
40
|
+
What was decided?
|
|
41
|
+
|
|
42
|
+
### Consequences
|
|
43
|
+
What tradeoffs or follow-on work does this create?
|
|
44
|
+
|
|
45
|
+
### Alternatives Considered
|
|
46
|
+
- Option A — why rejected
|
|
47
|
+
- Option B — why rejected
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Spec Template
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
# [Spec] <Feature>
|
|
54
|
+
|
|
55
|
+
## Objective
|
|
56
|
+
One-sentence deliverable
|
|
57
|
+
|
|
58
|
+
## Background
|
|
59
|
+
Why this feature exists
|
|
60
|
+
|
|
61
|
+
## Acceptance Criteria
|
|
62
|
+
- [ ] Specific, verifiable outcome 1
|
|
63
|
+
- [ ] Specific, verifiable outcome 2
|
|
64
|
+
|
|
65
|
+
## Implementation
|
|
66
|
+
- Branch: `feat/...`
|
|
67
|
+
- PR: <link>
|
|
68
|
+
- Tracker: <link>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Meeting Note Template
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
# Meeting: <Title> — YYYY-MM-DD
|
|
75
|
+
|
|
76
|
+
**Attendees:** Name1, Name2
|
|
77
|
+
**Type:** Planning / Review / Retrospective / Decision
|
|
78
|
+
|
|
79
|
+
## Summary
|
|
80
|
+
|
|
81
|
+
## Decisions Made
|
|
82
|
+
- Decision 1 (owner: Name)
|
|
83
|
+
|
|
84
|
+
## Action Items
|
|
85
|
+
- [ ] Action item (owner: Name, due: YYYY-MM-DD)
|
|
86
|
+
|
|
87
|
+
## Context / Discussion Notes
|
|
88
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
Last Updated: 2026-03-31
|
|
4
|
+
|
|
5
|
+
Reference: NX deep dive
|
|
6
|
+
|
|
7
|
+
- Generator schemas: examples and option tables
|
|
8
|
+
- `project.json` vs `workspace.json` migrations
|
|
9
|
+
- Visualize graph examples and troubleshooting cache hits
|
|
10
|
+
- CI examples: using `nx affected` in pipelines
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nx-workspace
|
|
3
|
-
description: "
|
|
3
|
+
description: "Run and generate NX targets, configure project.json, and visualize dependency graphs. Use when you say: 'run affected tests', 'nx generate a library', 'configure project.json', or 'show dependency graph'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
@@ -43,8 +43,11 @@ yarn nx run <project-name>:dev
|
|
|
43
43
|
### Code Generation
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
47
|
-
yarn nx
|
|
46
|
+
# Generate a library
|
|
47
|
+
yarn nx generate @nrwl/js:library ui --no-interactive
|
|
48
|
+
# Run affected builds/tests
|
|
49
|
+
yarn nx affected -t build
|
|
50
|
+
yarn nx affected -t test
|
|
48
51
|
```
|
|
49
52
|
|
|
50
53
|
### Formatting
|
|
@@ -71,10 +74,8 @@ jest --coverage | eslint --fix
|
|
|
71
74
|
|
|
72
75
|
## Best Practices
|
|
73
76
|
|
|
74
|
-
1.
|
|
77
|
+
1. Use `yarn nx run <project-name>:<target>` for explicit runs.
|
|
75
78
|
2. Use `yarn nx affected -t <target>` for multi-project changes.
|
|
76
|
-
3. Use exact project names from `project.json` files.
|
|
77
|
-
4. NX automatically handles task caching and parallel execution.
|
|
78
79
|
|
|
79
80
|
## NX MCP Server
|
|
80
81
|
|
|
@@ -96,13 +97,12 @@ The NX MCP server provides tools for understanding and working with the workspac
|
|
|
96
97
|
|
|
97
98
|
## Code Generation Workflow
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
See [REFERENCE.md](REFERENCE.md) for generator schemas and `project.json` examples.
|
|
100
101
|
|
|
101
102
|
### Phase 1: Discover
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
3. If no generator fits, check `nx_available_plugins`; only fall back to manual creation after exhausting all generator options
|
|
103
|
+
1. List available generators using the `nx_generators` MCP tool (plugin + local workspace generators).
|
|
104
|
+
2. Prefer local generators over plugin generators — they're customized for this repo.
|
|
105
|
+
3. If no generator fits, check `nx_available_plugins`; only fall back to manual creation after exhausting all generator options.
|
|
106
106
|
|
|
107
107
|
### Phase 2: Understand
|
|
108
108
|
|
|
@@ -121,7 +121,7 @@ yarn nx generate <generator-name> <options> --no-interactive
|
|
|
121
121
|
|
|
122
122
|
**CRITICAL**: Verify cwd before running — generators may use it to determine file placement.
|
|
123
123
|
|
|
124
|
-
On failure: read the error, adjust options, and retry. Use the
|
|
124
|
+
On failure: read the error, adjust options, and retry. Use the [self-improvement skill](../../skills/self-improvement/SKILL.md) for non-obvious fixes.
|
|
125
125
|
|
|
126
126
|
### Phase 4: Post-Generation
|
|
127
127
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
Playwright REFERENCE: MCP tools table, advanced `playwright.config.ts` snippets, and trace handling examples.
|
|
4
|
+
|
|
5
|
+
Keep large tables and MCP tool schemas here; `SKILL.md` references this file for quick workflows.
|
|
6
|
+
Last Updated: 2026-03-31
|
|
7
|
+
|
|
8
|
+
Reference: Playwright advanced
|
|
9
|
+
|
|
10
|
+
- CI examples for running `npx playwright test --project=chromium --reporter=html`
|
|
11
|
+
- Debugging: using `trace` files and `npx playwright show-report` walkthrough
|
|
12
|
+
- Example page-object templates and fixtures
|