跳到正文
cccskills
免费在 GitHub 公开

principle-separate-before-serializing-shared-state

Apply when changing shared mutable state, worker coordination, or task lifetimes in NeoHaskell framework internals. Reuse the owning subsystem, separate genuinely independent state, and use existing concurrency primitives where synchronization is required.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell星标 348(GitHub 348 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(2)

  • SKILL.md1.8 KB
  • agents/openai.yaml43 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Separate Before Serializing Shared State

Start with the framework subsystem that owns the state and its lifecycle, such as a dispatcher, store, or cache. Keep concurrency decisions there, behind operations callers can use. Keep pure transformations pure.

Why: Coordination belongs with the invariant it protects. Spreading mutable state or synchronization across callers makes the invariant harder to enforce. Instructions and conventions are not concurrency control.

Pattern:

  1. Find the owner and invariant. Identify the subsystem that owns the affected state or worker lifetime and read its existing concurrency design before changing it.
  2. Reuse or extend the owner's operations. If a new capability needs an atomic transition or coordinated lifecycle step, implement it at that boundary and have callers use it.
  3. Separate genuinely independent state. Prefer independent ownership when the state does not need to be shared. Preserve a canonical store or coordinated worker registry when its invariant requires one.
  4. Use NeoHaskell concurrency primitives when needed. Within the owning subsystem, read the relevant implementations in core/concurrency/ and choose the module whose ownership, blocking, atomicity, communication, and lifetime guarantees fit the operation. Preserve the whole transition: separately safe reads and writes may not form an atomic update. Follow the Foundational Thinking concurrency guidance.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

architect

免费

Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell3482026年10月26日 更新

arena

免费

Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell3482026年10月26日 更新

babysit

免费

Inspect or supervise a PR or stack through review and CI to merge-ready, using current GitHub evidence and the requested mode.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell3482026年10月26日 更新

Vet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it. Use when you benchmark or report a measured speedup or regression, including complete framework flows and compilation of projects that consume the framework.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell3482026年10月26日 更新

bro

免费

Restate the last message in plain human language, with no jargon.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell3482026年10月26日 更新

Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services. Use for CLI UX checks, startup regressions, memory leaks, hangs, prompt flows, or terminal demos.

中文简介正在准备中。当前显示原文说明。

neohaskell/NeoHaskell3482026年10月26日 更新

查看 neohaskell 的全部技能

报告此技能的问题