效果模块资源
diegosouzapw2026-10-28查看 1806复制 588
针对 `effect/Resource` 的指导,聚焦于 get、isResource 和 auto 等 API。当此模块为主要负责者时,在 `effect-skill-router` 之后加载。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md1483 chars
---
name: effect-module-resource
description: Guidance for `effect/Resource` focused on APIs like get, isResource, and auto. Load after `effect-skill-router` when this module is the primary owner.
---
# Effect Module Resource
## Owned scope
- Owns only `effect/Resource`.
- Source of truth: `packages/effect/src/Resource.ts`.
## What it is for
- Module-specific APIs and usage patterns for Effect programs.
## API quick reference
- `get`
- `isResource`
- `auto`
- `manual`
- `refresh`
- `Resource`
- Full API list: `references/api-reference.md`
## How to use it
- Treat stateful APIs as synchronization boundaries and keep updates atomic.
- Use the reference docs to select the smallest API surface that solves your task.
- Validate behavior against existing tests before introducing new usage patterns.
## Starter example
```ts
import { Resource } from "effect/Resource";
const value = Resource.get();
```
## Common pitfalls
- Prefer explicit, typed combinators over ad-hoc casting or unchecked assumptions.
## Not covered here
- Adjacent modules in `effect/*` and `effect/unstable/*` are out of scope for this owner.
## Escalate to
- `effect-skill-router` for routing and ownership checks.
## Reference anchors
- Module source: `packages/effect/src/Resource.ts`
- Representative tests: `packages/effect/test/Resource.test.ts`
- API details: `references/api-reference.md`
- Usage notes: `references/usage-reference.md`
- Ownership mapping: `references/owner.md`