[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B3J4GMT8MBF0GZX9NKS334":3,"skill-same:01M7B3J4GMT8MBF0GZX9NKS334":47},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7B3J4GMT8MBF0GZX9NKS334","principle-separate-before-serializing-shared-state",null,"Apply when concurrent actors might write to the same file, branch, key, or state object. Eliminate the sharing first; serialize structurally only when one shared writer is a real invariant.","merllinsbeard\u002Fmerlin-CTO","merllinsbeard","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F144795773?v=4","01M7B3C01C1PCBWFGB5T7YXSF8","merlin","01M7B3C023BBYDEPAPWBAGW9A7",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fprinciple-separate-before-serializing-shared-state\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: principle-separate-before-serializing-shared-state\ndescription: \"Apply when concurrent actors might write to the same file, branch, key, or state object. Eliminate the sharing first; serialize structurally only when one shared writer is a real invariant.\"\n---\n\n# Separate Before Serializing Shared State\n\nWhen concurrent actors might share mutable state, first ask whether they truly need the same mutable object. If not, eliminate the sharing. When sharing is real, enforce serialization structurally: lockfiles, sequential phases, exclusive ownership. Instructions and conventions are not concurrency control.\n\n**Why:** Concurrent writes to shared state create race conditions that are intermittent, hard to reproduce, and expensive to debug. Telling agents or goroutines to \"take turns\" does not work.\n\n**Pattern:**\n1. **Identify shared mutable state** (files both read and write, branches both push to, APIs both define and consume).\n2. **Default: eliminate the shared write target.** Ask: do these actors need one canonical object, or are they publishing independent facts? Give each actor its own owned file, key, branch, or state directory, and merge only at the read\u002Freporting boundary. Two workers writing their own `lastX` field into one `state.json` is still shared mutation; `indexer-state.json` + `metrics-state.json` is not.\n3. **Only when one shared write target is a real invariant, serialize access structurally** (lockfiles, sequential phases, single-writer actor, or atomic compare-and-swap). Treat \"we need a lock\" as a design smell to check, not as the default answer.\n\n\nSource: poteto\u002Fplugins pstack (MIT). Adapted for Hermes.\n","# Separate Before Serializing Shared State\n\nWhen concurrent actors might share mutable state, first ask whether they truly need the same mutable object. If not, eliminate the sharing. When sharing is real, enforce serialization structurally: lockfiles, sequential phases, exclusive ownership. Instructions and conventions are not concurrency control.\n\n**Why:** Concurrent writes to shared state create race conditions that are intermittent, hard to reproduce, and expensive to debug. Telling agents or goroutines to \"take turns\" does not work.\n\n**Pattern:**\n1. **Identify shared mutable state** (files both read and write, branches both push to, APIs both define and consume).\n2. **Default: eliminate the shared write target.** Ask: do these actors need one canonical object, or are they publishing independent facts? Give each actor its own owned file, key, branch, or state directory, and merge only at the read\u002Freporting boundary. Two workers writing their own `lastX` field into one `state.json` is still shared mutation; `indexer-state.json` + `metrics-state.json` is not.\n3. **Only when one shared write target is a real invariant, serialize access structurally** (lockfiles, sequential phases, single-writer actor, or atomic compare-and-swap). Treat \"we need a lock\" as a design smell to check, not as the default answer.\n\n\nSource: poteto\u002Fplugins pstack (MIT). Adapted for Hermes.\n",{"name":5,"description":7},"main","116bb09f1369e85cd8a54fec4135e218dca4a061","skills\u002Fprinciple-separate-before-serializing-shared-state",0,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Freleases\u002Flatest","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard","ai","2026-08-25 21:36:43",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add merllinsbeard\u002Fmerlin-CTO --skill principle-separate-before-serializing-shared-state",{"tool":39,"command":40},"bunx","bunx skills add merllinsbeard\u002Fmerlin-CTO --skill principle-separate-before-serializing-shared-state",{"tool":42,"command":43},"pnpm","pnpm dlx skills add merllinsbeard\u002Fmerlin-CTO --skill principle-separate-before-serializing-shared-state","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fprinciple-separate-before-serializing-shared-state\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7B3SK15WA8JW4G6RBKZR3ME","writing-for-agents","Use for delegate_task, Kanban, and all agent-facing text.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7B3SD78DTTXFVXGDPRK7249","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7B3S8ENS1XQ7YV3N5GV1PCF","vue-best-practices","Use for Vue 3, .vue files, Vue Router, or Pinia. Skip when the repo has no Vue.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fvue-best-practices\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7B3S2DPXMQN0EFFE8FTF03R","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7B3S06K4AGG5X59TCX900R6","tailwind-v4","Use when writing or reviewing Tailwind CSS v4 classes or migrating v3 syntax.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Ftailwind-v4\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7B3RXNDDCPJ7K5303BXXDTV","react-best-practices","Mastra React subset only. Generic React or Next uses vercel-react-best-practices.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Freact-best-practices\u002FSKILL.md",[],[]]