[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DN92QRPHS1V75AWCVEAZ5Y":3,"skill-same:01M7DN92QRPHS1V75AWCVEAZ5Y":49},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7DN92QRPHS1V75AWCVEAZ5Y","principle-separate-before-serializing-shared-state",null,"Separate before serializing shared state. Apply when concurrent actors might write to the same file, branch, key or state object.","erickb336\u002Fsage-stack","erickb336","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F141277478?v=4","01M7DN55Z7QX22W5GNQR20XF7K","Erick Benitez-Ramos","01M7DN5607YRAQJ52SS53JC8QK",2,"MIT","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage-codex\u002Fskills\u002Fprinciple-separate-before-serializing-shared-state\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: principle-separate-before-serializing-shared-state\ndescription: \"Separate before serializing shared state. Apply when concurrent actors might write to the same file, branch, key or state object.\"\nlicense: MIT\nmetadata:\n  source: \"pstack principle-separate-before-serializing-shared-state, MIT, Copyright (c) 2026 Lauren Tan, github.com\u002Fcursor\u002Fplugins, adapted; checked against pstack 0.15.36 at commit 0bb6f37\"\n---\n\n\u003C!-- Generated by scripts\u002Fbuild.mjs from the sources; edit the source, then run npm run build. -->\n\n# Separate before serializing shared state\n\nWhen concurrent actors might share state that changes, first ask whether they need the same object. If not, remove the sharing. When the sharing is real, enforce one writer at a time by structure: lock files, sequential phases or exclusive ownership. Instructions and conventions are not concurrency control.\n\n**Why.** Concurrent writes to shared state cause race conditions. They are intermittent, hard to reproduce and expensive to debug.\n\n**What to do.**\n1. **Find the shared state that changes:** files that both read and write, branches that both push to, APIs that both define and consume.\n2. **By default, remove the shared write target.** Ask: do these actors need one canonical object, or do they publish independent facts? Give each actor its own file, key, branch or state folder. Merge the results only where they are read or reported. Two actors that each write their own `lastX` field into one `state.json` still share it; `indexer-state.json` and `metrics-state.json` do not.\n3. **Only when one shared write target is a real invariant, serialise access by structure:** lock files, sequential phases, a single writer or an atomic compare-and-swap. Treat \"we need a lock\" as a design smell to check, not as the default answer.\n","\u003C!-- Generated by scripts\u002Fbuild.mjs from the sources; edit the source, then run npm run build. -->\n\n# Separate before serializing shared state\n\nWhen concurrent actors might share state that changes, first ask whether they need the same object. If not, remove the sharing. When the sharing is real, enforce one writer at a time by structure: lock files, sequential phases or exclusive ownership. Instructions and conventions are not concurrency control.\n\n**Why.** Concurrent writes to shared state cause race conditions. They are intermittent, hard to reproduce and expensive to debug.\n\n**What to do.**\n1. **Find the shared state that changes:** files that both read and write, branches that both push to, APIs that both define and consume.\n2. **By default, remove the shared write target.** Ask: do these actors need one canonical object, or do they publish independent facts? Give each actor its own file, key, branch or state folder. Merge the results only where they are read or reported. Two actors that each write their own `lastX` field into one `state.json` still share it; `indexer-state.json` and `metrics-state.json` do not.\n3. **Only when one shared write target is a real invariant, serialise access by structure:** lock files, sequential phases, a single writer or an atomic compare-and-swap. Treat \"we need a lock\" as a design smell to check, not as the default answer.\n",{"name":5,"license":15,"metadata":24,"description":7},{"source":25},"pstack principle-separate-before-serializing-shared-state, MIT, Copyright (c) 2026 Lauren Tan, github.com\u002Fcursor\u002Fplugins, adapted; checked against pstack 0.15.36 at commit 0bb6f37","main","221638798318c71adb12ba6bfeae74ed96ce18b4","plugins\u002Fsage-codex\u002Fskills\u002Fprinciple-separate-before-serializing-shared-state",0,"https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack","https:\u002F\u002Fgithub.com\u002Ferickb336","https:\u002F\u002Ferickbenitez.com","\"Life ain't a life till you live it\" - Mac Miller 🐐\r\n","2026-11-15 06:22:32",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add erickb336\u002Fsage-stack --skill principle-separate-before-serializing-shared-state",{"tool":41,"command":42},"bunx","bunx skills add erickb336\u002Fsage-stack --skill principle-separate-before-serializing-shared-state",{"tool":44,"command":45},"pnpm","pnpm dlx skills add erickb336\u002Fsage-stack --skill principle-separate-before-serializing-shared-state","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage-codex\u002Fskills\u002Fprinciple-separate-before-serializing-shared-state\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7DNEVZZ38XBEZE5ZPJ5T3PM","writing-standard","Write at 80% of Simplified Technical English. Apply to any text an agent writes for a person: messages, reports, specs, findings, reviews, plans.","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage\u002Fskills\u002Fwriting-standard\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7DNERBZCX43AQX9AQBH4M2H","sage","The state tool of sage mode: records tasks, routes, agent runs, findings, verdicts by head SHA and the user's gates in ~\u002F.claude\u002Fsage\u002F\u003Cproject>\u002F. Use in sage mode for every change of a task's state, and before any merge. Claude Code only.","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage\u002Fskills\u002Fsage\u002FSKILL.md",[],[],{"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":19},"01M7DNEDW87BEDR77AV0Q0BMZ5","sage-help","Help with sage: how to set it up, switch sage mode and autopilot, read the board, answer the chief's questions, pick a skill or a principle, fix a run that went wrong, and find where sage keeps its files. The user types \u002Fsage:sage-help (or \u002Fsage-help) with a question. Load it only when the user types it; do not load it on your own. Claude Code only.","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage\u002Fskills\u002Fsage-help\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7DNEAXQCF5BE34988JSA748","report","The report that every sage agent ends with: STATUS, RESULT, EVIDENCE, FINDINGS, QUESTIONS, NOT VERIFIED, BRANCH. Use at the end of any task that the sage chief of staff gave you. Claude Code only.","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage\u002Fskills\u002Freport\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DNE4PZR0QTAC0CJSFMB78N","remote-control","Set up Remote Control, so that the user can follow, steer and start Claude Code sessions from the Claude app on a phone. It turns Remote Control on for every new session, and it can run a server in a folder (such as ~\u002Fworkspace) that starts at each login. Use when the user asks to reach sessions or start new ones from a phone, or to set up, check or undo Remote Control. Claude Code only.","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage\u002Fskills\u002Fremote-control\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DNDZ70WK95HFCGNBGNVW5W","readme-guide","Write a project README. Apply when you write, change or review a README of any project, in any language.","https:\u002F\u002Fgithub.com\u002Ferickb336\u002Fsage-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fsage\u002Fskills\u002Freadme-guide\u002FSKILL.md",[],[]]