opencastle 0.32.12 → 0.32.13
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/README.md +5 -3
- package/package.json +1 -1
- 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 +6 -6
- 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 +6 -6
- 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/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/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 +1 -1
- 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,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: astro-framework
|
|
3
|
-
description: "
|
|
3
|
+
description: "Creates pages/layouts, defines content collections, configures hydration directives, and wires integrations. Use when adding or modifying Astro pages, layouts, components, or content collections. Trigger terms: Astro, content collection, client:load, client:visible, astro:content"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
@@ -21,23 +21,22 @@ src/
|
|
|
21
21
|
└── assets/ # processed images
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Implement Components
|
|
25
25
|
|
|
26
|
-
**Default: Zero JS** — `.astro` components render
|
|
26
|
+
**Default: Zero JS** — author `.astro` components that render HTML with no client-side JavaScript where possible.
|
|
27
27
|
|
|
28
|
-
**Islands Architecture** —
|
|
28
|
+
**Islands Architecture** — hydrate interactivity only where needed using `client:*` directives.
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### Component Example (concise)
|
|
31
31
|
|
|
32
32
|
```astro
|
|
33
33
|
---
|
|
34
34
|
interface Props { title: string; description?: string; }
|
|
35
35
|
const { title, description = 'Default description' } = Astro.props;
|
|
36
|
-
const data = await fetch('https://api.example.com/data').then(r => r.json());
|
|
37
36
|
---
|
|
38
37
|
<section>
|
|
39
38
|
<h2>{title}</h2>
|
|
40
|
-
|
|
39
|
+
<p>{description}</p>
|
|
41
40
|
</section>
|
|
42
41
|
<style>
|
|
43
42
|
section { max-width: 800px; margin: 0 auto; }
|
|
@@ -46,18 +45,22 @@ const data = await fetch('https://api.example.com/data').then(r => r.json());
|
|
|
46
45
|
|
|
47
46
|
### Client Directives (Islands)
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|-----------|-----------------|----------|
|
|
51
|
-
| `client:load` | Immediately on page load | Critical interactive UI |
|
|
52
|
-
| `client:idle` | After page is idle | Non-critical UI (analytics widgets) |
|
|
53
|
-
| `client:visible` | When element enters viewport | Below-the-fold components |
|
|
54
|
-
| `client:media="(max-width: 768px)"` | When media query matches | Mobile-only interactivity |
|
|
55
|
-
| `client:only="react"` | Client-only, no SSR | Components that can't server-render |
|
|
48
|
+
Use only the hydration directive required by the interaction to minimize shipped JS. Typical mappings:
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
- `client:load` — immediate hydration for critical interactive widgets
|
|
51
|
+
- `client:idle` — non-critical behavior after page idle
|
|
52
|
+
- `client:visible` — hydrate when visible (lazy)
|
|
53
|
+
- `client:media` — hydrate on media match
|
|
54
|
+
- `client:only` — last resort for non-SSR-able components
|
|
58
55
|
|
|
59
|
-
|
|
56
|
+
## Content Collections — Quick Workflow: add a new collection
|
|
57
|
+
1. Add collection schema in `src/content.config.ts` using `defineCollection` and Zod validators.
|
|
58
|
+
2. Create the folder under `src/content/<collection>` and add one sample `.md` or `.mdx` content file with frontmatter.
|
|
59
|
+
3. Run `pnpm build` and `pnpm dev` → run `node scripts/validate-content.js` (or your project's validation script) to verify typed collection imports.
|
|
60
|
+
4. Add a smoke query in a page that imports the collection (e.g., `const posts = await getCollection('blog')`) and confirm build-time typing.
|
|
61
|
+
5. Validation: ensure `pnpm build` exits zero and TypeScript reports no errors for collection types.
|
|
60
62
|
|
|
63
|
+
Define collections in `src/content.config.ts` (Astro v5+) using `astro:content` and export typed collections.
|
|
61
64
|
```ts
|
|
62
65
|
import { defineCollection, z } from 'astro:content';
|
|
63
66
|
import { glob } from 'astro/loaders';
|
|
@@ -117,16 +120,6 @@ Use `astro add` for react, tailwind, mdx, sitemap, node, vercel, netlify, cloudf
|
|
|
117
120
|
- **API routes**: Export `GET`/`POST` handlers from `src/pages/api/*.ts` returning `new Response(...)`.
|
|
118
121
|
- **Actions**: Use `defineAction` in `src/actions/index.ts` for type-safe server mutations with Zod validation.
|
|
119
122
|
|
|
120
|
-
## Anti-Patterns
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|-------------|---------------|-----------------|
|
|
124
|
-
| `client:load` on every component | Defeats zero-JS benefit, bloats bundle | Use `client:idle` or `client:visible` for non-critical UI |
|
|
125
|
-
| Importing large JS libraries in `.astro` | Runs at build but bundles nothing useful | Import in framework components with `client:*` |
|
|
126
|
-
| Skipping content collections for blog/docs | Manual file handling is error-prone | Use content collections with typed schemas |
|
|
127
|
-
| Hardcoding data in pages | Not maintainable, no type safety | Use content collections or fetch from APIs |
|
|
128
|
-
| Using `client:only` when SSR works | Loses SEO benefits and fast first paint | Use `client:load` or `client:visible` instead |
|
|
129
|
-
| Giant monolithic pages | Hard to maintain and test | Split into layouts + reusable components |
|
|
130
|
-
| Ignoring `astro add` for integrations | Manual config is error-prone | Use `astro add` for official integrations |
|
|
131
|
-
| Missing `alt` on images | Accessibility violation | Always provide descriptive `alt` text |
|
|
132
|
-
| Not using `astro:assets` for images | Missing optimization | Use `<Image>` from `astro:assets` |
|
|
123
|
+
## Anti-Patterns (moved to REFERENCE.md)
|
|
124
|
+
|
|
125
|
+
Extracted anti-patterns and SSR configuration details are available in `REFERENCE.md` in this directory to keep this skill focused and concise.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
Last Updated: 2026-03-31
|
|
4
|
+
|
|
5
|
+
Reference: Chrome DevTools MCP commands and responsive checklist
|
|
6
|
+
|
|
7
|
+
- Full MCP command table with parameter examples and common payload shapes
|
|
8
|
+
- Responsive verification scripts and `evaluate_script()` snippets
|
|
9
|
+
- Performance trace capture and analysis commands
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: browser-testing
|
|
3
|
-
description: "Chrome DevTools MCP
|
|
3
|
+
description: "Drive real browsers via Chrome DevTools MCP: navigate pages, capture snapshots, run responsive checks, and collect console/perf traces. Use when the user mentions: 'validate UI change in Chrome', 'capture a screenshot', 'run responsive checks', or 'collect console logs'. Trigger terms: browser testing, DevTools, console logs, screenshot, responsive testing"
|
|
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
|
# Browser Testing with Chrome DevTools MCP
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For project-specific test app, selectors, suites, and breakpoint config, see [testing-config.md](../../.opencastle/stack/testing-config.md).
|
|
11
11
|
|
|
12
|
-
## Purpose
|
|
13
|
-
|
|
14
|
-
After any UI change, validate in a real browser:
|
|
15
|
-
1. Start dev server if not running.
|
|
16
|
-
2. Navigate to affected pages.
|
|
17
|
-
3. Interact with UI elements (click, fill, filter).
|
|
18
|
-
4. Validate behavior and appearance.
|
|
19
|
-
5. Test edge cases (empty states, errors, boundaries).
|
|
20
|
-
6. Document findings with screenshots and pass/fail.
|
|
21
|
-
|
|
22
|
-
## Pre-Test Build Verification
|
|
23
|
-
|
|
24
|
-
**CRITICAL: Always build before browser testing.** Testing stale code wastes time. See [testing-config.md](../../.opencastle/stack/testing-config.md) for the specific build and serve commands.
|
|
25
12
|
|
|
26
13
|
## Chrome MCP Tools Reference
|
|
27
14
|
|
|
@@ -85,30 +72,27 @@ mcp_chrome-devtoo_performance_analyze_insight({ insightSetId: 'set_id', insightN
|
|
|
85
72
|
|
|
86
73
|
### 1. Setup
|
|
87
74
|
|
|
88
|
-
Start the dev server
|
|
75
|
+
Start the dev server.
|
|
89
76
|
|
|
90
77
|
### 2. Initial State
|
|
91
78
|
|
|
92
79
|
```javascript
|
|
93
80
|
mcp_chrome-devtoo_navigate_page({ type: 'url', url: 'http://localhost:<port>/places' })
|
|
94
81
|
mcp_chrome-devtoo_wait_for({ text: 'places' })
|
|
82
|
+
// If wait_for times out: verify dev server is running and URL is correct
|
|
95
83
|
mcp_chrome-devtoo_evaluate_script({
|
|
96
84
|
function: '() => ({ url: window.location.href, title: document.title })'
|
|
97
85
|
})
|
|
98
86
|
```
|
|
99
87
|
|
|
100
|
-
### 3. Test Interactions
|
|
88
|
+
### 3–4. Test Interactions & Edge Cases
|
|
101
89
|
|
|
102
90
|
```javascript
|
|
103
91
|
mcp_chrome-devtoo_click({ uid: 'filter_uid' })
|
|
104
92
|
mcp_chrome-devtoo_evaluate_script({
|
|
105
93
|
function: '() => document.querySelectorAll(".place-card").length'
|
|
106
94
|
})
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### 4. Test Edge Cases
|
|
110
95
|
|
|
111
|
-
```javascript
|
|
112
96
|
mcp_chrome-devtoo_navigate_page({
|
|
113
97
|
type: 'url', url: 'http://localhost:<port>/places?q=nonexistent-venue-xyz'
|
|
114
98
|
})
|
|
@@ -121,11 +105,12 @@ mcp_chrome-devtoo_evaluate_script({
|
|
|
121
105
|
|
|
122
106
|
```javascript
|
|
123
107
|
mcp_chrome-devtoo_list_console_messages()
|
|
108
|
+
// If errors found: fix source, rebuild, reload page, and re-run from step 2
|
|
124
109
|
```
|
|
125
110
|
|
|
126
|
-
### 6. Responsive Breakpoint Testing
|
|
111
|
+
### 6. Responsive Breakpoint Testing
|
|
127
112
|
|
|
128
|
-
|
|
113
|
+
Test every UI change at all responsive breakpoints — most layout bugs surface at smaller viewports. Define breakpoints in your project's testing config.
|
|
129
114
|
|
|
130
115
|
#### How to Resize
|
|
131
116
|
|
|
@@ -138,24 +123,8 @@ mcp_chrome-devtoo_resize_page({ width: 1440, height: 900 }) // Desktop
|
|
|
138
123
|
|
|
139
124
|
#### Per-Breakpoint Verification
|
|
140
125
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
At **each** breakpoint, check:
|
|
144
|
-
|
|
145
|
-
- [ ] Layout adapts correctly — no horizontal overflow
|
|
146
|
-
- [ ] Text truncates or wraps cleanly — no overlap
|
|
147
|
-
- [ ] Interactive elements have adequate spacing and touch targets
|
|
148
|
-
- [ ] Navigation and panels collapse/expand as expected
|
|
149
|
-
- [ ] Images and cards resize proportionally
|
|
150
|
-
|
|
151
|
-
#### Responsive Testing Anti-Patterns
|
|
152
|
-
|
|
153
|
-
| Anti-Pattern | Correct Approach |
|
|
154
|
-
|---|---|
|
|
155
|
-
| Testing only at desktop width | Test at all project-defined breakpoints |
|
|
156
|
-
| Skipping resize because "it uses Tailwind" | Tailwind classes can be wrong — always verify visually |
|
|
157
|
-
| Only checking layout, not interactions | Test filter drawers, dropdowns, and modals at each size |
|
|
158
|
-
| Taking 3 screenshots (one per breakpoint) | Use `evaluate_script()` to check layout; save screenshots for failures |
|
|
126
|
+
- Verify interactions at each size (not layout only)
|
|
127
|
+
- Prefer `evaluate_script()` assertions over screenshots; reserve screenshots for failures
|
|
159
128
|
|
|
160
129
|
## Regression Re-Test Workflow
|
|
161
130
|
|
|
@@ -169,20 +138,6 @@ When re-testing after a fix:
|
|
|
169
138
|
|
|
170
139
|
If any test still fails: analyze, fix, repeat. Do NOT stop.
|
|
171
140
|
|
|
172
|
-
## Validation Checklist
|
|
173
|
-
|
|
174
|
-
- [ ] Page loads without errors (check console)
|
|
175
|
-
- [ ] Changed component renders correctly
|
|
176
|
-
- [ ] Interactive elements respond to clicks/input
|
|
177
|
-
- [ ] Filters/sorting produce correct results
|
|
178
|
-
- [ ] URL parameters sync with UI state
|
|
179
|
-
- [ ] Empty states display when appropriate
|
|
180
|
-
- [ ] Error states handle gracefully
|
|
181
|
-
- [ ] Loading states appear during async operations
|
|
182
|
-
- [ ] Keyboard navigation works, focus is visible
|
|
183
|
-
- [ ] **Responsive: Tested at Mobile, Tablet, and Desktop breakpoints**
|
|
184
|
-
- [ ] **Responsive: No horizontal overflow at any breakpoint**
|
|
185
|
-
- [ ] **Responsive: Interactions work at every breakpoint (drawers, dropdowns, modals)**
|
|
186
141
|
|
|
187
142
|
## Context Management
|
|
188
143
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
# Contentful Reference (REFERENCE.md)
|
|
4
|
+
|
|
5
|
+
Last Updated: 2026-03-31
|
|
6
|
+
|
|
7
|
+
## Migration & Rollback Patterns
|
|
8
|
+
|
|
9
|
+
- Best safe rollback: perform migrations in a sandbox environment and validate before promoting to `master`. If a migration is faulty, delete the sandbox and recreate it from `master` then re-run a corrected migration.
|
|
10
|
+
- Advanced rollback: write reverse migrations that undo schema changes (when feasible) and test them in sandbox.
|
|
11
|
+
|
|
12
|
+
## Validation Checklist
|
|
13
|
+
|
|
14
|
+
1. Query a representative sample of entries after migration and confirm required fields and unique constraints.
|
|
15
|
+
2. Run the site's build against sandbox content to catch runtime rendering issues.
|
|
16
|
+
3. Run integration tests that depend on the modified content types.
|
|
@@ -1,45 +1,85 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: contentful-cms
|
|
3
|
-
description: "Contentful
|
|
3
|
+
description: "Creates Contentful content types, queries entries via GraphQL/REST, runs CLI migrations, and manages assets and locales. Use when building or modifying Contentful content models, writing queries, or migrating content."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
-
|
|
8
6
|
# Contentful CMS
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Critical Development Rules
|
|
13
|
-
|
|
14
|
-
1. **Always use Content Types** — define structured content types before creating entries
|
|
15
|
-
2. **Prefer GraphQL API** — use the GraphQL Content API for typed, efficient queries
|
|
16
|
-
3. **Handle localization** — Contentful fields can be localized; always specify locale in queries
|
|
17
|
-
4. **Use environments** — develop in sandbox environments, promote to master via migrations
|
|
18
|
-
5. **Migration scripts** — use the Contentful CLI migration tool for schema changes, never modify content types manually in production
|
|
19
|
-
6. **Rich Text rendering** — use `@contentful/rich-text-react-renderer` for React apps
|
|
20
|
-
7. **Asset handling** — use Contentful's Image API for responsive images with transformations
|
|
21
|
-
8. **Webhook-driven** — use webhooks for cache invalidation and rebuild triggers
|
|
22
|
-
9. **Rate limiting** — respect API rate limits (Content Delivery: 78 req/s, Management: 10 req/s)
|
|
23
|
-
10. **Keep queries in shared library** — queries belong in a shared queries library, never inline in components
|
|
8
|
+
For project-specific configuration, content types, and API keys, see [cms-config.md](../../.opencastle/stack/cms-config.md).
|
|
24
9
|
|
|
25
10
|
## Query Patterns
|
|
26
11
|
|
|
27
12
|
### GraphQL Content API
|
|
28
|
-
- Use typed GraphQL queries with code generation
|
|
29
13
|
- Leverage `sys.publishedAt` for cache invalidation
|
|
30
14
|
- Use `include` parameter to control link resolution depth
|
|
31
|
-
- Filter with `where` clauses for efficient data fetching
|
|
32
15
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
```typescript
|
|
17
|
+
// Example: Typed GraphQL query
|
|
18
|
+
const BLOG_POSTS_QUERY = `
|
|
19
|
+
query BlogPosts($limit: Int!, $locale: String!) {
|
|
20
|
+
blogPostCollection(limit: $limit, locale: $locale) {
|
|
21
|
+
items {
|
|
22
|
+
sys { id publishedAt }
|
|
23
|
+
title
|
|
24
|
+
slug
|
|
25
|
+
body { json }
|
|
26
|
+
featuredImage { url width height }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
```
|
|
38
32
|
|
|
39
33
|
## Content Modeling
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
```javascript
|
|
36
|
+
// Reference field with validation
|
|
37
|
+
blogPost.createField('author')
|
|
38
|
+
.type('Link').linkType('Entry')
|
|
39
|
+
.validations([{ linkContentType: ['person'] }]);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Prefer typed content types over JSON fields; add validation rules to all required fields.
|
|
43
|
+
|
|
44
|
+
## Migration Workflow
|
|
45
|
+
|
|
46
|
+
1. Create a sandbox environment using the Contentful web UI or API.
|
|
47
|
+
2. Write a migration script using the Contentful migration library (example below).
|
|
48
|
+
3. Run the migration against the sandbox:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
contentful space migration --space-id <SPACE_ID> --environment-id sandbox migration.js
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. Validate changes:
|
|
55
|
+
- Run a small validation script that queries a sample of affected entries and ensures required fields exist.
|
|
56
|
+
- If validation fails: roll back by deleting the sandbox and recreate from `master` (safe rollback), or write a reverse migration and run it.
|
|
57
|
+
5. When sandbox validation passes, promote the environment or run the migration against `master` during a maintenance window.
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
// Example: Migration script (migration.js)
|
|
61
|
+
module.exports = function (migration) {
|
|
62
|
+
const blogPost = migration.createContentType('blogPost')
|
|
63
|
+
.name('Blog Post')
|
|
64
|
+
.displayField('title');
|
|
65
|
+
blogPost.createField('title').type('Symbol').required(true);
|
|
66
|
+
blogPost.createField('slug').type('Symbol').required(true).validations([{ unique: true }]);
|
|
67
|
+
blogPost.createField('body').type('RichText');
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Validation script example (node):
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
// validate.js — exits non-zero on missing fields
|
|
75
|
+
const res = await fetch(`https://cdn.contentful.com/spaces/${SPACE}/environments/sandbox/entries?content_type=blogPost`, {
|
|
76
|
+
headers: { Authorization: `Bearer ${TOKEN}` },
|
|
77
|
+
});
|
|
78
|
+
const { items } = await res.json();
|
|
79
|
+
for (const item of items) {
|
|
80
|
+
if (!item.fields.slug) throw new Error(`Missing slug on ${item.sys.id}`);
|
|
81
|
+
}
|
|
82
|
+
console.log('OK —', items.length, 'entries validated');
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
For longer migration patterns and rollback options see [REFERENCE.md](REFERENCE.md).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
Last Updated: 2026-03-31
|
|
4
|
+
|
|
5
|
+
Reference: Convex patterns and safety checks
|
|
6
|
+
|
|
7
|
+
- Schema migration checklist and `npx convex deploy` notes
|
|
8
|
+
- Query/mutation examples with `returns` validators
|
|
9
|
+
- Backup/rollback using `npx convex export` / `npx convex import`
|
|
@@ -7,7 +7,7 @@ description: "Convex reactive database patterns, schema design, real-time querie
|
|
|
7
7
|
|
|
8
8
|
# Convex Database
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For project-specific schema, functions, and deployment details, see [database-config.md](../../.opencastle/stack/database-config.md).
|
|
11
11
|
|
|
12
12
|
## Critical Development Rules
|
|
13
13
|
|
|
@@ -106,3 +106,15 @@ export const create = mutation({
|
|
|
106
106
|
- Use `npx convex dev` for local development with hot reload
|
|
107
107
|
- Schema changes are automatically migrated
|
|
108
108
|
- Use `npx convex import` / `npx convex export` for data management
|
|
109
|
+
|
|
110
|
+
## Quick Workflow: Implement a schema change and deploy
|
|
111
|
+
1. Add or modify schema in `convex/schema.ts` and run `npx convex dev` locally; confirm the dev server starts and responds (checkpoint: `http://localhost:8888` or the configured port). Run a small validation script or sample queries to verify schema changes (validation checkpoint).
|
|
112
|
+
2. Write queries/mutations with `returns` validators and unit test against the dev server.
|
|
113
|
+
3. Run `npx convex deploy` to push the change to production.
|
|
114
|
+
4. Verify real-time queries in the app, run a small data migration if required (`convex import/export`), and run a quick smoke check against your app (example):
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
curl -fsS https://<APP_URL>/health || (echo "health check failed" && exit 1)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
If an issue occurs: roll back via `npx convex import` of the last good export, fix locally, and re-deploy. After a rollback, re-run the same smoke check to confirm services are restored.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cypress-testing
|
|
3
|
-
description: "Cypress E2E and
|
|
3
|
+
description: "Writes Cypress E2E/component tests, configures `cy.intercept()` and `cy.session()`, authors custom commands, and wires CI artifacts. Use when creating E2E specs, component tests, or CI test pipelines. Trigger terms: cypress, e2e, component test, cy.intercept, cy.session"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
-
|
|
8
6
|
# Cypress Testing
|
|
9
7
|
|
|
10
8
|
Cypress-specific E2E and component testing patterns. For project-specific test configuration and breakpoints, see [testing-config.md](../../.opencastle/stack/testing-config.md).
|
|
@@ -12,46 +10,36 @@ Cypress-specific E2E and component testing patterns. For project-specific test c
|
|
|
12
10
|
## Commands
|
|
13
11
|
|
|
14
12
|
```bash
|
|
15
|
-
|
|
16
|
-
npx cypress
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
npx cypress run
|
|
20
|
-
npx cypress run --component # Run component tests only
|
|
21
|
-
npx cypress run --record # Record to Cypress Cloud
|
|
13
|
+
# Interactive runner
|
|
14
|
+
npx cypress open
|
|
15
|
+
|
|
16
|
+
# Headless run (CI) — target a specific spec with --spec when needed
|
|
17
|
+
npx cypress run
|
|
22
18
|
```
|
|
23
19
|
|
|
20
|
+
## Workflow (install → add data-testid → write → run → CI)
|
|
21
|
+
|
|
22
|
+
1. Install and verify: `npm install --save-dev cypress` then `npx cypress verify`.
|
|
23
|
+
2. Add `data-testid` attributes to key elements. Write custom commands in `cypress/support/commands.ts`, configure `cy.intercept()` stubs, and author fixtures under `cypress/fixtures/`.
|
|
24
|
+
3. Write focused tests under `cypress/e2e/` using `data-testid` selectors. After authoring a spec, validate the setup by running a single spec: `npx cypress run --spec "cypress/e2e/auth/login.cy.ts" --headed` (quick smoke check).
|
|
25
|
+
4. Run locally: `npx cypress open` (interactive) or `npx cypress run` (headless). If a spec fails, re-run the failing spec directly and inspect `cypress/screenshots/` and `cypress/videos/` for evidence.
|
|
26
|
+
5. CI: `npx cypress run` — assert exit code 0; upload videos/screenshots on failures.
|
|
27
|
+
|
|
28
|
+
|
|
24
29
|
## Test Structure
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
cypress/
|
|
28
|
-
├── e2e/ # E2E test specs
|
|
29
|
-
│ ├── auth/
|
|
30
|
-
│ │ ├── login.cy.ts
|
|
31
|
-
│ │ └── signup.cy.ts
|
|
32
|
-
│ └── dashboard/
|
|
33
|
-
│ └── overview.cy.ts
|
|
34
|
-
├── fixtures/ # Test data (JSON)
|
|
35
|
-
│ └── users.json
|
|
36
|
-
├── support/
|
|
37
|
-
│ ├── commands.ts # Custom commands
|
|
38
|
-
│ ├── e2e.ts # E2E support file
|
|
39
|
-
│ └── component.ts # Component test support
|
|
40
|
-
└── downloads/ # Downloaded files during tests
|
|
41
|
-
```
|
|
31
|
+
Tests: `cypress/e2e/` • Fixtures: `cypress/fixtures/` • Commands: `cypress/support/commands.ts`
|
|
42
32
|
|
|
43
33
|
## Writing Tests
|
|
44
34
|
|
|
45
|
-
### E2E Test Pattern
|
|
35
|
+
### E2E Test Pattern (single focused spec)
|
|
46
36
|
|
|
47
37
|
```typescript
|
|
48
38
|
// cypress/e2e/auth/login.cy.ts
|
|
49
39
|
describe('Login', () => {
|
|
50
|
-
beforeEach(() =>
|
|
51
|
-
cy.visit('/login');
|
|
52
|
-
});
|
|
40
|
+
beforeEach(() => cy.visit('/login'));
|
|
53
41
|
|
|
54
|
-
it('
|
|
42
|
+
it('logs in with valid credentials and lands on dashboard', () => {
|
|
55
43
|
cy.get('[data-testid="email-input"]').type('user@example.com');
|
|
56
44
|
cy.get('[data-testid="password-input"]').type('password123');
|
|
57
45
|
cy.get('[data-testid="login-button"]').click();
|
|
@@ -59,14 +47,6 @@ describe('Login', () => {
|
|
|
59
47
|
cy.url().should('include', '/dashboard');
|
|
60
48
|
cy.get('[data-testid="user-menu"]').should('be.visible');
|
|
61
49
|
});
|
|
62
|
-
|
|
63
|
-
it('should show error for invalid credentials', () => {
|
|
64
|
-
cy.get('[data-testid="email-input"]').type('wrong@example.com');
|
|
65
|
-
cy.get('[data-testid="password-input"]').type('wrong');
|
|
66
|
-
cy.get('[data-testid="login-button"]').click();
|
|
67
|
-
|
|
68
|
-
cy.get('[data-testid="error-message"]').should('contain', 'Invalid credentials');
|
|
69
|
-
});
|
|
70
50
|
});
|
|
71
51
|
```
|
|
72
52
|
|
|
@@ -87,59 +67,15 @@ Cypress.Commands.add('login', (email: string, password: string) => {
|
|
|
87
67
|
|
|
88
68
|
## Selector Strategy
|
|
89
69
|
|
|
90
|
-
Priority
|
|
91
|
-
|
|
92
|
-
1. `data-testid` attributes — most resilient to UI changes
|
|
93
|
-
2. `aria-label` or `role` — accessible and meaningful
|
|
94
|
-
3. Dedicated CSS classes — avoid styling classes
|
|
95
|
-
4. **Never** use tag names, auto-generated classes, or fragile CSS paths
|
|
96
|
-
|
|
97
|
-
## Best Practices
|
|
98
|
-
|
|
99
|
-
- Use `cy.intercept()` to stub/spy on API calls — don't depend on backend state
|
|
100
|
-
- Use `cy.session()` for authentication — avoid logging in before every test
|
|
101
|
-
- Avoid `cy.wait(ms)` — use `cy.intercept()` with aliases instead
|
|
102
|
-
- Assert on visible elements — Cypress auto-retries, so assertions are resilient
|
|
103
|
-
- Keep tests independent — each test should set up its own state
|
|
104
|
-
- Use fixtures for test data — avoid hardcoding values in tests
|
|
105
|
-
- Add `data-testid` attributes to components during development, not retroactively
|
|
106
|
-
|
|
107
|
-
## CI Configuration
|
|
108
|
-
|
|
109
|
-
```yaml
|
|
110
|
-
# GitHub Actions example
|
|
111
|
-
cypress:
|
|
112
|
-
runs-on: ubuntu-latest
|
|
113
|
-
steps:
|
|
114
|
-
- uses: actions/checkout@v4
|
|
115
|
-
- uses: cypress-io/github-action@v6
|
|
116
|
-
with:
|
|
117
|
-
build: npm run build
|
|
118
|
-
start: npm run start
|
|
119
|
-
wait-on: 'http://localhost:3000'
|
|
120
|
-
browser: chrome
|
|
121
|
-
```
|
|
70
|
+
Priority: prefer `data-testid`, then `aria-*` attributes or `role`. Avoid fragile selectors (auto-generated classes, deep CSS paths). See [REFERENCE.md](REFERENCE.md) for CI selector consistency rules.
|
|
122
71
|
|
|
123
|
-
##
|
|
72
|
+
## Best Practices (Cypress-specific and non-obvious)
|
|
124
73
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
video: false,
|
|
134
|
-
screenshotOnRunFailure: true,
|
|
135
|
-
defaultCommandTimeout: 10000,
|
|
136
|
-
retries: { runMode: 2, openMode: 0 },
|
|
137
|
-
},
|
|
138
|
-
component: {
|
|
139
|
-
devServer: {
|
|
140
|
-
framework: 'next',
|
|
141
|
-
bundler: 'webpack',
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
```
|
|
74
|
+
- Prefer `cy.intercept()` with deterministic fixture payloads over test-time seeding for flaky network scenarios
|
|
75
|
+
- Use `cy.session()` with serialized auth state to speed repeatable suites; persist and reuse tokens across related specs
|
|
76
|
+
- Use route alias scoping (unique `@alias` names per spec) to avoid cross-test waits when running in parallel
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
For CI pipeline examples and `cypress.config.ts` snippets, see [REFERENCE.md](REFERENCE.md).
|
|
80
|
+
|
|
81
|
+
For advanced configuration examples and CI optimizations, see [REFERENCE.md](REFERENCE.md).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
### Figma → CSS Translation Rules (reference)
|
|
4
|
+
|
|
5
|
+
| Figma Concept | Code Equivalent |
|
|
6
|
+
|---------------|----------------|
|
|
7
|
+
| Auto Layout → horizontal | `display: flex; flex-direction: row` |
|
|
8
|
+
| Auto Layout → vertical | `display: flex; flex-direction: column` |
|
|
9
|
+
| Auto Layout gap | `gap: Npx` |
|
|
10
|
+
| Auto Layout padding | `padding: top right bottom bottom` |
|
|
11
|
+
| Fill → Hug contents | `width: auto` or `width: fit-content` |
|
|
12
|
+
| Fill → Fixed | `width: Npx` |
|
|
13
|
+
| Fill → Fill container | `flex: 1` or `width: 100%` |
|
|
14
|
+
| Corner radius | `border-radius: Npx` |
|
|
15
|
+
| Drop shadow | `box-shadow: x y blur spread color` |
|
|
16
|
+
| Opacity | `opacity: N` |
|
|
17
|
+
|
|
18
|
+
Examples and extended mapping (spacing, typography, effects) live here for agent consumption.
|