[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NQ9X2N9KQFRPMDZJE02Y28":3,"skill-same:01M6NQ9X2N9KQFRPMDZJE02Y28":63},{"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":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":14,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M6NQ9X2N9KQFRPMDZJE02Y28","kv-or-stream",null,"Decide between KV Watch and JetStream Stream for a new communication path. Use when designing inter-component communication, adding new message flows, or choosing storage primitives.","C360Studio\u002Fsemteams","C360Studio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F107274645?v=4","01M6NQ809JZG513TZ7FJX8SAKQ","Complete 360 Studio","01M6NQ80DRB447R1H9W554K7V8",0,"MIT","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkv-or-stream\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"stream","kv or stream","storage","component","communication","decide","primitives","use","message","watch","flows","path","jetstream","for","when","new","2026-11-10 10:12:30",false,"---\nname: kv-or-stream\ndescription: Decide between KV Watch and JetStream Stream for a new communication path. Use when designing inter-component communication, adding new message flows, or choosing storage primitives.\nargument-hint: [description of the communication being designed]\n---\n\n# KV Watch vs JetStream Stream Decision\n\n## What are you designing?\n\n$ARGUMENTS\n\n## The 4-Test Heuristic\n\nApply these tests in order. The first clear answer is usually sufficient.\n\n### Test 1: Restart Test (sharpest)\n\nIf this processor restarted, should it re-process messages it already handled?\n\n- **Yes** (re-process is correct recovery) --> **KV Watch**\n- **No** (re-process would be wrong) --> **JetStream Stream**\n\n### Test 2: Fan-out vs Queue\n\nShould multiple processors all react to this, or should only one handle it?\n\n- **All react** (fan-out) --> **KV Watch**\n- **Only one handles it** (queue) --> **JetStream Stream**\n\n### Test 3: Processing Time\n\nIs the processing fast and idempotent, or slow with real side effects?\n\n- **Fast and idempotent** --> **KV Watch**\n- **Slow or has side effects** --> **JetStream Stream**\n\n### Test 4: Nature Test\n\nIs this a fact about the world, or a request to do something?\n\n- **Fact** (entity state, index entry, current status) --> **KV Watch**\n- **Request** (execute task, call LLM, run tool) --> **JetStream Stream**\n\n## Conflict Check\n\nIf any test gives conflicting answers, the concept may be two things conflated. Revisit whether it should be split into separate concerns.\n\n## Common Cases Reference\n\n| Communication | Primitive | Reason |\n|--------------|-----------|--------|\n| Entity state changed | KV Watch | Fact; fan-out; fast; idempotent |\n| New task to execute | JetStream Stream | Request; queue; expensive; side effects |\n| Index update | KV Write (others watch) | Fact; fan-out; fast |\n| LLM call | JetStream Stream | Request; queue; slow; costly |\n| Loop current state | KV | Fact; queryable; recoverable |\n| Tool execution request | JetStream Stream | Request; queue; side effects |\n| Tool result returned | JetStream Stream | Response; once; push delivery |\n| Workflow trigger | JetStream Stream | Request; queue; expensive |\n| Workflow execution state | KV | Fact; queryable; recoverable |\n| Sensor telemetry | KV Write | Fact; latest-value semantics |\n\n## Key Architecture Context\n\n**The KV Twofer**: Every NATS KV bucket is backed by a JetStream stream. A single KV write gives you three interfaces simultaneously:\n- **State**: `kv.Get(key)` returns current value\n- **Events**: `kv.Watch(pattern)` fires on every change (fan-out)\n- **History**: Replay from any revision for audit trail\n\n**Bootstrap phase**: When a KV watcher starts, it delivers ALL current values matching the pattern, then a `nil` entry signals transition to live updates. Processors must distinguish bootstrap from live to avoid treating existing entities as \"new\" events on restart.\n\n**JetStream consumers**: With `DeliverPolicy: \"new\"` on a durable consumer, restart resumes from last ack. No replay of already-handled messages.\n\n**Using both is normal**: A component using KV for state AND JetStream for work items in the same process is the standard pattern (see agentic-loop).\n\nRead `docs\u002Fconcepts\u002F03-streams-vs-kv-watches.md` for full documentation.\nRead `docs\u002Fconcepts\u002F02-kv-twofer.md` for KV Twofer details.\n","# KV Watch vs JetStream Stream Decision\n\n## What are you designing?\n\n$ARGUMENTS\n\n## The 4-Test Heuristic\n\nApply these tests in order. The first clear answer is usually sufficient.\n\n### Test 1: Restart Test (sharpest)\n\nIf this processor restarted, should it re-process messages it already handled?\n\n- **Yes** (re-process is correct recovery) --> **KV Watch**\n- **No** (re-process would be wrong) --> **JetStream Stream**\n\n### Test 2: Fan-out vs Queue\n\nShould multiple processors all react to this, or should only one handle it?\n\n- **All react** (fan-out) --> **KV Watch**\n- **Only one handles it** (queue) --> **JetStream Stream**\n\n### Test 3: Processing Time\n\nIs the processing fast and idempotent, or slow with real side effects?\n\n- **Fast and idempotent** --> **KV Watch**\n- **Slow or has side effects** --> **JetStream Stream**\n\n### Test 4: Nature Test\n\nIs this a fact about the world, or a request to do something?\n\n- **Fact** (entity state, index entry, current status) --> **KV Watch**\n- **Request** (execute task, call LLM, run tool) --> **JetStream Stream**\n\n## Conflict Check\n\nIf any test gives conflicting answers, the concept may be two things conflated. Revisit whether it should be split into separate concerns.\n\n## Common Cases Reference\n\n| Communication | Primitive | Reason |\n|--------------|-----------|--------|\n| Entity state changed | KV Watch | Fact; fan-out; fast; idempotent |\n| New task to execute | JetStream Stream | Request; queue; expensive; side effects |\n| Index update | KV Write (others watch) | Fact; fan-out; fast |\n| LLM call | JetStream Stream | Request; queue; slow; costly |\n| Loop current state | KV | Fact; queryable; recoverable |\n| Tool execution request | JetStream Stream | Request; queue; side effects |\n| Tool result returned | JetStream Stream | Response; once; push delivery |\n| Workflow trigger | JetStream Stream | Request; queue; expensive |\n| Workflow execution state | KV | Fact; queryable; recoverable |\n| Sensor telemetry | KV Write | Fact; latest-value semantics |\n\n## Key Architecture Context\n\n**The KV Twofer**: Every NATS KV bucket is backed by a JetStream stream. A single KV write gives you three interfaces simultaneously:\n- **State**: `kv.Get(key)` returns current value\n- **Events**: `kv.Watch(pattern)` fires on every change (fan-out)\n- **History**: Replay from any revision for audit trail\n\n**Bootstrap phase**: When a KV watcher starts, it delivers ALL current values matching the pattern, then a `nil` entry signals transition to live updates. Processors must distinguish bootstrap from live to avoid treating existing entities as \"new\" events on restart.\n\n**JetStream consumers**: With `DeliverPolicy: \"new\"` on a durable consumer, restart resumes from last ack. No replay of already-handled messages.\n\n**Using both is normal**: A component using KV for state AND JetStream for work items in the same process is the standard pattern (see agentic-loop).\n\nRead `docs\u002Fconcepts\u002F03-streams-vs-kv-watches.md` for full documentation.\nRead `docs\u002Fconcepts\u002F02-kv-twofer.md` for KV Twofer details.\n",{"name":5,"description":7,"argument-hint":40},[41],"description of the communication being designed","main","9b1ec2f24adbbc9121f3d9322f9d414fdc16e016",".agents\u002Fskills\u002Fkv-or-stream","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams","https:\u002F\u002Fc360studio.github.io","https:\u002F\u002Fgithub.com\u002FC360Studio","2026-11-11 01:13:46",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add C360Studio\u002Fsemteams --skill kv-or-stream",{"tool":55,"command":56},"bunx","bunx skills add C360Studio\u002Fsemteams --skill kv-or-stream",{"tool":58,"command":59},"pnpm","pnpm dlx skills add C360Studio\u002Fsemteams --skill kv-or-stream","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkv-or-stream\u002FSKILL.md",true,[],[64,84,103,137,148,167],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":35},"01M6NQEE3V8S4HEVMFVFW7SEQ4","store-pattern","Choose the right state management approach for a use case. Decide between component-local state, derived state, runes-based stores, SvelteKit load, or URL state.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002Fui\u002F.claude\u002Fskills\u002Fstore-pattern\u002FSKILL.md",[],[71,72,73,74,75,32,76,77,22,78,26,79,80,81,82,24,83],"store pattern","store","pattern","URL","load","managed","case","local","state management","state","sveltekit","choose","management",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":35},"01M6NQE4Z802R8B8PBE23JRR5W","new-component","Step-by-step checklist for adding a new Svelte 5 component with proper patterns, tests, and TypeScript types. Use when creating new UI components.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002Fui\u002F.claude\u002Fskills\u002Fnew-component\u002FSKILL.md",[],[22,91,34,92,93,94,95,96,26,97,98,99,100,101,102,32,33],"new component","svelte","types","patterns","checklist","svelte 5","ui","components","typescript","tests","ui components","with",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":119,"publishedAt":35},"01M6NQDYRKF89279J9A2D9Q892","backend-integration","Connect the UI to semstreams backend APIs. Covers proxy routing, fetch patterns, SSR considerations, and real-time data. Use when adding new backend integrations or debugging API issues.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002Fui\u002F.claude\u002Fskills\u002Fbackend-integration\u002FSKILL.md",[109,114],{"categoryNo":110,"categoryName":111,"taxonomyType":112,"taxonomyTypeDesc":113},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[120,121,122,34,123,124,125,126,94,26,127,128,129,130,33,97,131,132,133,134,135,136],"backend integration","backend","integration","api endpoint","data","backend integrations","time","fetch","integrations","api","real-time","proxy","issues","routing","connect","debugging","ssr",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":35},"01M6NQDW39CHJMCCQZA696N1Y7","review-pr","Adapter for review-pr.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-pr\u002FSKILL.md",[],[144,145,146,147,32,139],"pr","review pr","review","adapter",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":157,"publishedAt":35},"01M6NQD8CX3BCRHN8BRFTVJJ01","query-pattern","Choose the right query access pattern (GraphQL, MCP, NATS Direct) for a use case. Use when designing query APIs, adding new access points, or choosing between gateway types.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fquery-pattern\u002FSKILL.md",[154],{"categoryNo":155,"categoryName":156,"taxonomyType":112,"taxonomyTypeDesc":113},"01JBSEEDCAT000000000000023","Skill与智能体开发",[158,73,159,26,34,33,32,93,77,160,161,82,162,163,164,165,166],"query pattern","query","scenario","nats","direct","access","GraphQL","gateway","MCP",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":35},"01M6NQD73AJADQC2G9005KPNPN","preflight","Adapter for preflight.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemteams\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpreflight\u002FSKILL.md",[],[169,32,147]]