[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72VSTNARCQAXHHJHWAK8K42":3,"skill-same:01M72VSTNARCQAXHHJHWAK8K42":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":39,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M72VSTNARCQAXHHJHWAK8K42","meteor-pubsub",null,"Use when authoring or debugging Meteor publications and subscriptions (Meteor.publish, Meteor.subscribe). Triggers on publication strategies (SERVER_MERGE, NO_MERGE, NO_MERGE_NO_HISTORY), the low-level publish API (added\u002Fchanged\u002Fremoved), cursor authorization, reactive joins, leaked documents. Use this skill when the user asks about pub\u002Fsub or asks about reactive data fetching.","meteor\u002Fagent-skills","meteor","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F789528?v=4","01M72VQVFCJ72XHP7ZKS3774NA","Meteor","01M72VQVG5VZ0X5VCQYM0MCK1Q",11,"MIT","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmeteor-pubsub\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: meteor-pubsub\ndescription: >\n  Use when authoring or debugging Meteor publications and subscriptions\n  (Meteor.publish, Meteor.subscribe). Triggers on publication strategies\n  (SERVER_MERGE, NO_MERGE, NO_MERGE_NO_HISTORY), the low-level publish API\n  (added\u002Fchanged\u002Fremoved), cursor authorization, reactive joins, leaked\n  documents. Use this skill when the user asks about pub\u002Fsub or asks about\n  reactive data fetching.\nmetadata:\n  author: meteor\n  kind: knowledge\n  meteor: \">=3.0\"\n  area: data\n  tagline: \"Author and debug publications\u002Fsubscriptions (publish strategies, low-level `added\u002Fchanged\u002Fremoved`, authorization, reactive joins).\"\n  bundle: [\"essentials\", \"fullstack\"]\n  docs_synced_at: \"2026-09-29\"\nlicense: MIT\n---\n\n# Meteor publications and subscriptions\n\nPublications stream a set of documents to subscribed clients and keep them\nlive. The publication is the only place server-side authorization can\nfilter rows before they reach the client.\n\n## Decision flow\n\n1. Does the client need this data reactively? If no, prefer a method (one-shot\n   read). If yes, use a publication.\n2. Is the data user-specific? Filter by `this.userId` inside the publish\n   function. Without that filter, documents leak across users.\n3. Can the publication be expressed as a single cursor? Return it directly.\n4. Does it need one async lookup before choosing a cursor? Use an async\n   publish handler, await the lookup, then return the cursor.\n5. Does it need per-document async joins, custom aggregation output, or an\n   external reactive source? Drop to the low-level `this.added` \u002F\n   `this.changed` \u002F `this.removed` API.\n\n## Scaffold\n\n```javascript\nimport { Meteor } from \"meteor\u002Fmeteor\";\nimport { Items } from \"\u002Fimports\u002Fapi\u002Fitems\";\n\nMeteor.publish(\"items.mine\", function () {\n  if (!this.userId) {\n    return this.ready();\n  }\n  return Items.find(\n    { ownerId: this.userId },\n    { fields: { title: 1, qty: 1, updatedAt: 1 }, sort: { updatedAt: -1 } },\n  );\n});\n```\n\nProject `fields` whenever the collection contains columns the subscriber\nmust not receive.\n\nAsync publish handlers may also return a cursor:\n\n```javascript\nMeteor.publish(\"items.byTeam\", async function (teamId) {\n  const member = await Memberships.findOneAsync({\n    teamId,\n    userId: this.userId,\n  });\n  if (!member) return this.ready();\n  return Items.find({ teamId }, { fields: { title: 1, qty: 1 } });\n});\n```\n\nMeteor awaits the handler before processing the returned cursor.\n\n## Subscribing\n\n```javascript\nimport { Meteor } from \"meteor\u002Fmeteor\";\n\nconst handle = Meteor.subscribe(\"items.mine\");\n\u002F\u002F React \u002F Blaze \u002F Svelte hooks observe handle.ready() and the local cursor.\nhandle.stop();\n```\n\n## Publication strategies\n\nSet per-collection with `Meteor.server.setPublicationStrategy`. Three options:\n\n```javascript\nimport { DDPServer } from \"meteor\u002Fddp-server\";\n\nMeteor.server.setPublicationStrategy(\n  \"items\",\n  DDPServer.publicationStrategies.NO_MERGE,\n);\n```\n\n| Strategy             | When to use                                                                 |\n|----------------------|-----------------------------------------------------------------------------|\n| `SERVER_MERGE`       | Default. Tracks merged document fields across publications and sends deltas. |\n| `NO_MERGE`           | Tracks sent document IDs so unsubscribe can remove them. Use when the collection is owned by one publication. |\n| `NO_MERGE_NO_HISTORY`| Remembers nothing and sends no removals on stop. Reserve for send-and-forget queues where stale client documents are intentional. |\n\nSee `references\u002Fpublication-strategies.md`.\n\n## Low-level publish API\n\nFor joins or async work:\n\n```javascript\nMeteor.publish(\"feed\", async function () {\n  const cursor = Posts.find({}, { fields: { title: 1, authorId: 1 } });\n  const observer = await cursor.observeChangesAsync({\n    added: async (id, doc) => {\n      const author = await Users.findOneAsync(doc.authorId, {\n        fields: { username: 1 },\n      });\n      this.added(\"feed\", id, { ...doc, authorName: author?.username });\n    },\n    changed: (id, changes) => this.changed(\"feed\", id, changes),\n    removed: (id) => this.removed(\"feed\", id),\n  });\n\n  this.ready();\n  this.onStop(() => observer.stop());\n});\n```\n\nNote: cursor `transform` functions remain synchronous. Use a separate\npublication or the low-level API for per-document async joins.\n\nLive observer delivery does not wait for one async callback before later\nchanges arrive. If ordering or backpressure matters, serialize the work with a\nper-subscription Promise queue. Attach an error policy and stop the observer\nfrom `this.onStop`; see `references\u002Flow-level-publish-api.md`.\n\n## Anti-patterns\n\n- Publish without a `this.userId` filter when data is user-specific.\n- Publish sensitive or unnecessary columns. Add a `fields` projection when\n  the full document is not part of the publication contract.\n- Confuse an async publish handler with an async cursor transform. Meteor\n  awaits the handler Promise, but each transform callback must return a\n  document synchronously.\n- Use cursor transforms for async joins. Transforms are synchronous; the\n  low-level API is the right tool.\n- Subscribe to large unbounded collections. Page the data with `limit`\u002F`skip`.\n\n## See also\n\n- `references\u002Fpublication-strategies.md`\n- `references\u002Flow-level-publish-api.md`\n- `references\u002Feval-cases.md`\n","# Meteor publications and subscriptions\n\nPublications stream a set of documents to subscribed clients and keep them\nlive. The publication is the only place server-side authorization can\nfilter rows before they reach the client.\n\n## Decision flow\n\n1. Does the client need this data reactively? If no, prefer a method (one-shot\n   read). If yes, use a publication.\n2. Is the data user-specific? Filter by `this.userId` inside the publish\n   function. Without that filter, documents leak across users.\n3. Can the publication be expressed as a single cursor? Return it directly.\n4. Does it need one async lookup before choosing a cursor? Use an async\n   publish handler, await the lookup, then return the cursor.\n5. Does it need per-document async joins, custom aggregation output, or an\n   external reactive source? Drop to the low-level `this.added` \u002F\n   `this.changed` \u002F `this.removed` API.\n\n## Scaffold\n\n```javascript\nimport { Meteor } from \"meteor\u002Fmeteor\";\nimport { Items } from \"\u002Fimports\u002Fapi\u002Fitems\";\n\nMeteor.publish(\"items.mine\", function () {\n  if (!this.userId) {\n    return this.ready();\n  }\n  return Items.find(\n    { ownerId: this.userId },\n    { fields: { title: 1, qty: 1, updatedAt: 1 }, sort: { updatedAt: -1 } },\n  );\n});\n```\n\nProject `fields` whenever the collection contains columns the subscriber\nmust not receive.\n\nAsync publish handlers may also return a cursor:\n\n```javascript\nMeteor.publish(\"items.byTeam\", async function (teamId) {\n  const member = await Memberships.findOneAsync({\n    teamId,\n    userId: this.userId,\n  });\n  if (!member) return this.ready();\n  return Items.find({ teamId }, { fields: { title: 1, qty: 1 } });\n});\n```\n\nMeteor awaits the handler before processing the returned cursor.\n\n## Subscribing\n\n```javascript\nimport { Meteor } from \"meteor\u002Fmeteor\";\n\nconst handle = Meteor.subscribe(\"items.mine\");\n\u002F\u002F React \u002F Blaze \u002F Svelte hooks observe handle.ready() and the local cursor.\nhandle.stop();\n```\n\n## Publication strategies\n\nSet per-collection with `Meteor.server.setPublicationStrategy`. Three options:\n\n```javascript\nimport { DDPServer } from \"meteor\u002Fddp-server\";\n\nMeteor.server.setPublicationStrategy(\n  \"items\",\n  DDPServer.publicationStrategies.NO_MERGE,\n);\n```\n\n| Strategy             | When to use                                                                 |\n|----------------------|-----------------------------------------------------------------------------|\n| `SERVER_MERGE`       | Default. Tracks merged document fields across publications and sends deltas. |\n| `NO_MERGE`           | Tracks sent document IDs so unsubscribe can remove them. Use when the collection is owned by one publication. |\n| `NO_MERGE_NO_HISTORY`| Remembers nothing and sends no removals on stop. Reserve for send-and-forget queues where stale client documents are intentional. |\n\nSee `references\u002Fpublication-strategies.md`.\n\n## Low-level publish API\n\nFor joins or async work:\n\n```javascript\nMeteor.publish(\"feed\", async function () {\n  const cursor = Posts.find({}, { fields: { title: 1, authorId: 1 } });\n  const observer = await cursor.observeChangesAsync({\n    added: async (id, doc) => {\n      const author = await Users.findOneAsync(doc.authorId, {\n        fields: { username: 1 },\n      });\n      this.added(\"feed\", id, { ...doc, authorName: author?.username });\n    },\n    changed: (id, changes) => this.changed(\"feed\", id, changes),\n    removed: (id) => this.removed(\"feed\", id),\n  });\n\n  this.ready();\n  this.onStop(() => observer.stop());\n});\n```\n\nNote: cursor `transform` functions remain synchronous. Use a separate\npublication or the low-level API for per-document async joins.\n\nLive observer delivery does not wait for one async callback before later\nchanges arrive. If ordering or backpressure matters, serialize the work with a\nper-subscription Promise queue. Attach an error policy and stop the observer\nfrom `this.onStop`; see `references\u002Flow-level-publish-api.md`.\n\n## Anti-patterns\n\n- Publish without a `this.userId` filter when data is user-specific.\n- Publish sensitive or unnecessary columns. Add a `fields` projection when\n  the full document is not part of the publication contract.\n- Confuse an async publish handler with an async cursor transform. Meteor\n  awaits the handler Promise, but each transform callback must return a\n  document synchronously.\n- Use cursor transforms for async joins. Transforms are synchronous; the\n  low-level API is the right tool.\n- Subscribe to large unbounded collections. Page the data with `limit`\u002F`skip`.\n\n## See also\n\n- `references\u002Fpublication-strategies.md`\n- `references\u002Flow-level-publish-api.md`\n- `references\u002Feval-cases.md`\n",{"name":5,"license":15,"metadata":24,"description":33},{"area":25,"kind":26,"author":9,"bundle":27,"meteor":30,"tagline":31,"docs_synced_at":32},"data","knowledge",[28,29],"essentials","fullstack",">=3.0","Author and debug publications\u002Fsubscriptions (publish strategies, low-level `added\u002Fchanged\u002Fremoved`, authorization, reactive joins).","2026-09-29","Use when authoring or debugging Meteor publications and subscriptions (Meteor.publish, Meteor.subscribe). Triggers on publication strategies (SERVER_MERGE, NO_MERGE, NO_MERGE_NO_HISTORY), the low-level publish API (added\u002Fchanged\u002Fremoved), cursor authorization, reactive joins, leaked documents. Use this skill when the user asks about pub\u002Fsub or asks about reactive data fetching.\n","main","9f41f992bbaa9705d4c18ae766b24e7f9e62a997","skills\u002Fmeteor-pubsub",3,"https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills","https:\u002F\u002Fdocs.meteor.com\u002F","https:\u002F\u002Fgithub.com\u002Fmeteor","https:\u002F\u002Fmeteor.com\u002F","2026-11-13 22:00:21",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add meteor\u002Fagent-skills --skill meteor-pubsub",{"tool":49,"command":50},"bunx","bunx skills add meteor\u002Fagent-skills --skill meteor-pubsub",{"tool":52,"command":53},"pnpm","pnpm dlx skills add meteor\u002Fagent-skills --skill meteor-pubsub","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmeteor-pubsub\u002FSKILL.md",true,[57,63,67],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Feval-cases.md","REFERENCE","参考文档",4499,"https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmeteor-pubsub\u002Freferences\u002Feval-cases.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Flow-level-publish-api.md",2435,"https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmeteor-pubsub\u002Freferences\u002Flow-level-publish-api.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fpublication-strategies.md",3508,"https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmeteor-pubsub\u002Freferences\u002Fpublication-strategies.md",[72,79,86,93,100,107],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M72VVSHP4F20VMPYR6BG38EW","good-skill","Use when authoring a fixture skill for the validator. Triggers on validator unit tests. Use this skill when asserting the happy path through frontmatter validation.","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fvalid\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M72VVQ4ZS36ASMYGDP7TARR2","meteor-foo","Use when testing the zip builder. Triggers on build-zips unit tests. Ask about archive layout.","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskills-for-zip\u002Fmeteor-foo\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M72VVMYGBZHDJZRGD1H99RDB","_internal","Use when testing internal artifact exclusions. Triggers on ZIP builder tests.","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskills-for-zip\u002F_internal\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M72VVKD7N2TBZWYMD8MV47YN","internal-review","Use when testing that maintainer skills stay outside published ZIP artifacts.","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskills-for-zip\u002F.github\u002Fskills\u002Finternal-review\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M72VVGX8NSSZ2CZK5PW1K56V","oversize-body","Use when the body exceeds 8 KB. Triggers on validator size-limit testing.","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Finvalid\u002Foversize-body\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M72VVF6G3G6GB86GSMASE4T4","one-trigger","Use when a description has only one trigger phrase and nothing else useful enough to push past the heuristic.","https:\u002F\u002Fgithub.com\u002Fmeteor\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Finvalid\u002Fone-trigger\u002FSKILL.md",[],[]]