stateful-lifecycle-audit
仓库创建 2026年1月20日最近提交 22 天前SkillHot 收录 21 天前
▸ 精选理由
帮助避免状态不一致与资源泄露,适合复杂后端
这个 Skill 做什么
审查含单例、缓存或长期资源的代码生命周期与所有权
审查包含 singleton、memoization、缓存、lazy loading、互斥体或长期外部资源的代码,重点追踪生命周期与所有权关系。在创建、修改或 code review 有状态逻辑时使用,能防止资源泄露、竞态和重置不一致的问题。特色是把 guard、resource、reset 和测试串起来检查,确保各方对状态的理解一致。
▸ 展开 SKILL.md 英文原文
Use before creating, modifying, or reviewing code with singleton state, memoization, lazy loading, caches, registries, mutexes, unload/reset paths, or long-lived external resources
3
Stars
0
Forks
14
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ton-anywhere/my-favorite-prompts/main/skills/stateful-lifecycle-audit/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ton-anywhere/my-favorite-prompts/main/skills/stateful-lifecycle-audit/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# Stateful Lifecycle Audit ## Overview Stateful code is not correct because it has a familiar shape. Trace ownership and execution. The guard, resource, reset, and tests must all agree about the same state. ## When to Use Use for code involving: - singleton instances, class variables, class instance variables, or module globals - memoization, caches, registries, warmup, lazy loading, unload, or reset paths - mutexes, thread-local/request-local state, background lifecycle jobs, or long-lived resources - expensive constructors such as model/session/client/tokenizer/database connection loaders Do not use for stateless pure functions with no persistent resource or lifecycle behavior. ## Au
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有