[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EF9EPARADSPQK9BSXY8H05":3,"skill-same:01M6EF9EPARADSPQK9BSXY8H05":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EF9EPARADSPQK9BSXY8H05","keystonejs",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fkeystonejs\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# KeystoneJS — Headless CMS & Application Framework\n\n\n## Overview\n\n\nKeystoneJS, the open-source headless CMS and application platform built on Node.js, GraphQL, and Prisma. Helps developers define content schemas, build admin interfaces, implement access control, and create custom GraphQL APIs for content-driven applications.\n\n\n## Instructions\n\n### Schema Definition\n\nDefine your data model with Keystone's list API:\n\n```typescript\n\u002F\u002F keystone.ts — Main Keystone configuration\nimport { config, list } from \"@keystone-6\u002Fcore\";\nimport { allowAll } from \"@keystone-6\u002Fcore\u002Faccess\";\nimport {\n  text, relationship, timestamp, select, integer,\n  image, json, checkbox, password, float,\n} from \"@keystone-6\u002Fcore\u002Ffields\";\nimport { document } from \"@keystone-6\u002Ffields-document\";\n\nexport default config({\n  db: {\n    provider: \"postgresql\",         \u002F\u002F \"postgresql\" | \"sqlite\" | \"mysql\"\n    url: process.env.DATABASE_URL!,\n  },\n\n  lists: {\n    \u002F\u002F Blog post content type\n    Post: list({\n      access: allowAll,             \u002F\u002F Will customize below\n      fields: {\n        title: text({\n          validation: { isRequired: true },\n          isIndexed: \"unique\",\n        }),\n        slug: text({\n          validation: { isRequired: true },\n          isIndexed: \"unique\",\n          hooks: {\n            \u002F\u002F Auto-generate slug from title if not provided\n            resolveInput({ resolvedData, item }) {\n              if (!resolvedData.slug && resolvedData.title) {\n                return resolvedData.title\n                  .toLowerCase()\n                  .replace(\u002F[^a-z0-9]+\u002Fg, \"-\")\n                  .replace(\u002F^-|-$\u002Fg, \"\");\n              }\n              return resolvedData.slug;\n            },\n          },\n        }),\n        status: select({\n          options: [\n            { label: \"Draft\", value: \"draft\" },\n            { label: \"Published\", value: \"published\" },\n            { label: \"Archived\", value: \"archived\" },\n          ],\n          defaultValue: \"draft\",\n          ui: { displayMode: \"segmented-control\" },\n        }),\n        content: document({\n          \u002F\u002F Rich text editor with custom blocks\n          formatting: true,\n          links: true,\n          dividers: true,\n          layouts: [\n            [1, 1],                 \u002F\u002F Two-column layout\n            [1, 1, 1],             \u002F\u002F Three-column layout\n          ],\n          componentBlocks: {},     \u002F\u002F Custom editor components\n        }),\n        heroImage: image({\n          storage: \"localImages\",  \u002F\u002F Configured in storage section\n        }),\n        publishedAt: timestamp(),\n        author: relationship({\n          ref: \"User.posts\",       \u002F\u002F Bidirectional relationship\n          ui: { displayMode: \"cards\", cardFields: [\"name\", \"email\"] },\n        }),\n        categories: relationship({\n          ref: \"Category.posts\",\n          many: true,              \u002F\u002F Many-to-many relationship\n          ui: { displayMode: \"select\" },\n        }),\n        readingTime: integer({\n          ui: { createView: { fieldMode: \"hidden\" } },  \u002F\u002F Auto-calculated\n          hooks: {\n            resolveInput({ resolvedData }) {\n              if (resolvedData.content) {\n                const wordCount = JSON.stringify(resolvedData.content).split(\u002F\\s+\u002F).length;\n                return Math.ceil(wordCount \u002F 200);  \u002F\u002F ~200 words per minute\n              }\n              return undefined;\n            },\n          },\n        }),\n      },\n    }),\n\n    \u002F\u002F Category taxonomy\n    Category: list({\n      access: allowAll,\n      fields: {\n        name: text({ validation: { isRequired: true }, isIndexed: \"unique\" }),\n        description: text({ ui: { displayMode: \"textarea\" } }),\n        posts: relationship({ ref: \"Post.categories\", many: true }),\n      },\n    }),\n\n    \u002F\u002F User with authentication\n    User: list({\n      access: allowAll,\n      fields: {\n        name: text({ validation: { isRequired: true } }),\n        email: text({ validation: { isRequired: true }, isIndexed: \"unique\" }),\n        password: password({\n          validation: { isRequired: true, length: { min: 8 } },\n        }),\n        role: select({\n          options: [\n            { label: \"Admin\", value: \"admin\" },\n            { label: \"Editor\", value: \"editor\" },\n            { label: \"Author\", value: \"author\" },\n          ],\n          defaultValue: \"author\",\n        }),\n        posts: relationship({ ref: \"Post.author\", many: true }),\n      },\n    }),\n  },\n\n  \u002F\u002F File storage configuration\n  storage: {\n    localImages: {\n      kind: \"local\",\n      type: \"image\",\n      generateUrl: (path) => `\u002Fimages${path}`,\n      serverRoute: { path: \"\u002Fimages\" },\n      storagePath: \"public\u002Fimages\",\n    },\n  },\n\n  \u002F\u002F Authentication\n  session: {\n    maxAge: 60 * 60 * 24 * 30,     \u002F\u002F 30 days\n    secret: process.env.SESSION_SECRET!,\n  },\n});\n```\n\n### Access Control\n\nImplement fine-grained permissions:\n\n```typescript\n\u002F\u002F access.ts — Role-based access control rules\nimport { ListAccessArgs } from \"@keystone-6\u002Fcore\u002Ftypes\";\n\n\u002F\u002F Helper to check if user is authenticated\nfunction isSignedIn({ session }: ListAccessArgs) {\n  return !!session;\n}\n\n\u002F\u002F Helper to check user role\nfunction hasRole(role: string) {\n  return ({ session }: ListAccessArgs) => session?.data?.role === role;\n}\n\n\u002F\u002F Post-specific access rules\nexport const postAccess = {\n  operation: {\n    query: allowAll,                        \u002F\u002F Anyone can read published posts\n    create: isSignedIn,                     \u002F\u002F Must be logged in to create\n    update: isSignedIn,\n    delete: hasRole(\"admin\"),               \u002F\u002F Only admins can delete\n  },\n  filter: {\n    \u002F\u002F Non-admins can only see published posts (in query results)\n    query: ({ session }: ListAccessArgs) => {\n      if (session?.data?.role === \"admin\") return {};  \u002F\u002F Admins see everything\n      return { status: { equals: \"published\" } };\n    },\n    \u002F\u002F Authors can only update their own posts\n    update: ({ session }: ListAccessArgs) => {\n      if (session?.data?.role === \"admin\") return {};\n      return { author: { id: { equals: session?.itemId } } };\n    },\n  },\n  item: {\n    \u002F\u002F Additional per-item checks\n    update: async ({ session, item }: any) => {\n      \u002F\u002F Editors can update any post, authors only their own\n      if (session?.data?.role === \"editor\") return true;\n      return item.authorId === session?.itemId;\n    },\n  },\n};\n```\n\n### Custom GraphQL Extensions\n\nAdd custom queries and mutations:\n\n```typescript\n\u002F\u002F schema.extensions.ts — Extend the auto-generated GraphQL API\nimport { graphql } from \"@keystone-6\u002Fcore\";\n\nexport const extendGraphqlSchema = graphql.extend((base) => ({\n  query: {\n    \u002F\u002F Custom query: get featured posts\n    featuredPosts: graphql.field({\n      type: graphql.list(graphql.nonNull(base.object(\"Post\"))),\n      args: { limit: graphql.arg({ type: graphql.Int, defaultValue: 5 }) },\n      async resolve(source, { limit }, context) {\n        return context.db.Post.findMany({\n          where: {\n            status: { equals: \"published\" },\n          },\n          orderBy: { publishedAt: \"desc\" },\n          take: limit,\n        });\n      },\n    }),\n\n    \u002F\u002F Custom query: site statistics\n    siteStats: graphql.field({\n      type: graphql.object(\"SiteStats\")({\n        fields: {\n          totalPosts: graphql.field({ type: graphql.Int }),\n          totalUsers: graphql.field({ type: graphql.Int }),\n          totalCategories: graphql.field({ type: graphql.Int }),\n        },\n      }),\n      async resolve(source, args, context) {\n        const [posts, users, categories] = await Promise.all([\n          context.db.Post.count({ where: { status: { equals: \"published\" } } }),\n          context.db.User.count(),\n          context.db.Category.count(),\n        ]);\n        return {\n          totalPosts: posts,\n          totalUsers: users,\n          totalCategories: categories,\n        };\n      },\n    }),\n  },\n\n  mutation: {\n    \u002F\u002F Custom mutation: publish a post\n    publishPost: graphql.field({\n      type: base.object(\"Post\"),\n      args: { id: graphql.arg({ type: graphql.nonNull(graphql.ID) }) },\n      async resolve(source, { id }, context) {\n        return context.db.Post.updateOne({\n          where: { id },\n          data: {\n            status: \"published\",\n            publishedAt: new Date().toISOString(),\n          },\n        });\n      },\n    }),\n  },\n}));\n```\n\n### Webhooks and Hooks\n\nReact to data changes with lifecycle hooks:\n\n```typescript\n\u002F\u002F hooks\u002Fpost-hooks.ts — Lifecycle hooks for post content\nimport { ListHooks } from \"@keystone-6\u002Fcore\u002Ftypes\";\n\nexport const postHooks: ListHooks\u003Cany> = {\n  \u002F\u002F Before saving to the database\n  resolveInput: {\n    create: async ({ resolvedData, context }) => {\n      \u002F\u002F Auto-set the author to the current user\n      if (!resolvedData.author && context.session) {\n        resolvedData.author = { connect: { id: context.session.itemId } };\n      }\n      return resolvedData;\n    },\n  },\n\n  \u002F\u002F After saving — trigger side effects\n  afterOperation: {\n    create: async ({ item, context }) => {\n      \u002F\u002F Send notification when a new post is created\n      console.log(`New post created: ${item.title}`);\n    },\n    update: async ({ item, originalItem, context }) => {\n      \u002F\u002F Trigger revalidation when a post is published\n      if (originalItem.status !== \"published\" && item.status === \"published\") {\n        await fetch(`${process.env.FRONTEND_URL}\u002Fapi\u002Frevalidate`, {\n          method: \"POST\",\n          headers: { \"Content-Type\": \"application\u002Fjson\" },\n          body: JSON.stringify({\n            secret: process.env.REVALIDATION_SECRET,\n            path: `\u002Fposts\u002F${item.slug}`,\n          }),\n        });\n      }\n    },\n  },\n\n  \u002F\u002F Validate before saving\n  validateInput: async ({ resolvedData, addValidationError }) => {\n    if (resolvedData.status === \"published\" && !resolvedData.content) {\n      addValidationError(\"Cannot publish a post without content\");\n    }\n  },\n};\n```\n\n## Installation\n\n```bash\n# Create a new Keystone project\nnpm create keystone-app@latest my-cms\n\n# Or add to existing project\nnpm install @keystone-6\u002Fcore @keystone-6\u002Ffields-document\n\n# Run in development mode (auto-generates Prisma schema + Admin UI)\nnpx keystone dev\n# Admin UI at http:\u002F\u002Flocalhost:3000\n# GraphQL playground at http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fgraphql\n```\n\n\n## Examples\n\n\n### Example 1: Setting up Keystonejs with a custom configuration\n\n**User request:**\n\n```\nI just installed Keystonejs. Help me configure it for my TypeScript + React workflow with my preferred keybindings.\n```\n\nThe agent creates the configuration file with TypeScript-aware settings, configures relevant plugins\u002Fextensions for React development, sets up keyboard shortcuts matching the user's preferences, and verifies the setup works correctly.\n\n### Example 2: Extending Keystonejs with custom functionality\n\n**User request:**\n\n```\nI want to add a custom access control to Keystonejs. How do I build one?\n```\n\nThe agent scaffolds the extension\u002Fplugin project, implements the core functionality following Keystonejs's API patterns, adds configuration options, and provides testing instructions to verify it works end-to-end.\n\n\n## Guidelines\n\n1. **Schema is code** — Define your content model in TypeScript; get auto-generated Admin UI, GraphQL API, and database migrations\n2. **Use relationships over IDs** — Let Keystone manage foreign keys; bidirectional relationships (`ref: \"Post.author\"`) keep data consistent\n3. **Access control from the start** — Don't use `allowAll` in production; define operation + filter + item level access per list\n4. **Document field for rich content** — The document field gives editors a structured rich text experience with custom blocks\n5. **Hooks for business logic** — Use `afterOperation` for side effects (notifications, cache invalidation, webhooks)\n6. **Custom GraphQL for complex queries** — Extend the schema for aggregations, full-text search, or multi-step operations\n7. **Prisma migrations** — Keystone uses Prisma under the hood; run `keystone prisma migrate` for production migrations\n8. **Separate API from admin** — In production, protect the admin UI behind authentication; expose only the GraphQL API publicly\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fkeystonejs",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill keystonejs",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill keystonejs",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill keystonejs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fkeystonejs\u002FSKILL.md",true,[],[46,55,64,73,79,85],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[52,53,54],"model","model hierarchy","model hierarchy skill",{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[61,62,63],"MCP","zoom","zoom mcp",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[70,71,72,62],"sdk","zoom apps sdk","apps",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[75],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[87]]