migrate-document-fields
Migrate Keystone document fields (@keystone-6/fields-document) to OpenSaaS Stack tiptap rich text fields. Invoke as a forked subagent, passing the config file path and document field details.
What this skill does
Migrate the Keystone document fields described below to OpenSaaS Stack's Tiptap rich text fields. This involves config changes, package updates, and a data format note for existing content.
$ARGUMENTS
## The Change
**Keystone** uses a proprietary document editor from `@keystone-6/fields-document`:
```typescript
import { document } from '@keystone-6/fields-document'
content: document({
formatting: true,
links: true,
dividers: true,
layouts: [
[1, 1],
[1, 1, 1],
],
})
```
**OpenSaaS Stack** uses Tiptap (ProseMirror-based) from `@opensaas/stack-tiptap`:
```typescript
import { richText } from '@opensaas/stack-tiptap/fields'
content: richText()
```
Both store JSON in the database, but **the JSON formats are different** (see data migration note below).
## Step 1: Update the Config
```diff
- import { document } from '@keystone-6/fields-document'
+ import { richText } from '@opensaas/stack-tiptap/fields'
content: document({
- formatting: true,
- links: true,
- dividers: true,
- layouts: [[1, 1]],
- })
+ content: richText()
```
All document field options (`formatting`, `links`, `dividers`, `layouts`) are dropped — Tiptap's toolbar is configured at the UI level, not the field level.
## Step 2: Update package.json
The user needs to install `@opensaas/stack-tiptap` and its peer dependencies:
```bash
pnpm add @opensaas/stack-tiptap
pnpm remove @keystone-6/fields-document
```
## Step 3: Register the Tiptap UI component
In the admin page (`app/admin/[[...admin]]/page.tsx` or similar):
```typescript
// lib/register-fields.ts
'use client'
import { registerFieldComponent } from '@opensaas/stack-ui'
import { RichTextFieldComponent } from '@opensaas/stack-tiptap'
registerFieldComponent('richText', RichTextFieldComponent)
```
Then import it in the admin page as a side effect:
```typescript
import '../../../lib/register-fields'
```
## Data Migration Note
**The Keystone document format and Tiptap's ProseMirror JSON format are different.** Existing content stored in the database will not automatically render correctly in the Tiptap editor.
If the project has existing document content that must be preserved:
- The old Keystone document JSON looks like: `[{ "type": "paragraph", "children": [{ "text": "..." }] }]` (Slate-based)
- The new Tiptap JSON looks like: `{ "type": "doc", "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "..." }] }] }`
**Options:**
1. **Accept format mismatch** — old content won't render until re-saved in the new editor (acceptable for many projects)
2. **Write a data transformation script** — convert the Keystone format to Tiptap format using a Node.js script (complex, project-specific)
Write a comment in the code for any document fields that had existing content so the user knows to address it:
```typescript
// NOTE: This field was migrated from Keystone document format.
// Existing content may not render correctly until re-saved in the Tiptap editor.
// See specs/keystone-document-migration.md for data migration guidance.
content: richText()
```
## Steps
1. Read the config file to find all `document()` fields
2. Replace each with `richText()`, update imports
3. Note the package changes needed (`pnpm add @opensaas/stack-tiptap`, `pnpm remove @keystone-6/fields-document`)
4. Search for any admin page setup files to identify where the field component registration should go
5. Add the `// NOTE:` comment above each migrated field
6. Report: what was changed, what packages to install, and whether existing data may need transformation
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.