用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/OneKeyHQ/app-monorepo --skill 1k-state-management命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Analyze accumulated bug fix cases and propose updates to the self-testing checklist. Use periodically (weekly/monthly) to evolve quality checks based on real issues.
OneKey i18n and Lokalise workflow for searching, adding, updating, pulling, and using translation keys. Verify the target project and full locale coverage; never edit generated translation files.
Review OneKey PRs and diffs for security, correctness, concurrency, React/RN pitfalls, and repository-specific regressions. Use for code review or 审查 PR.
基于 SOC 职业分类
| name | 1k-state-management |
| description | Jotai state management patterns — atoms, globalAtom, contextAtom, and persistence. |
| allowed-tools | Read, Grep, Glob, Write, Edit |
packages/kit-bg/src/states/jotai/atoms/globalAtom and EAtomNames for standardizationsettings.ts, account.ts, hardware.ts, currency.tspackages/kit/src/states/jotai/contexts/[feature_name]/atoms.tscontextAtom from createJotaiContext for consistencycontexts/
├── marketV2/
│ ├── atoms.ts - State definitions
│ ├── actions.ts - State operations
│ └── index.ts - Exports
├── swap/
│ ├── atoms.ts
│ ├── actions.ts
│ └── index.ts
packages/kit/src/views/globalAtom and contextAtom patterns without architectural justificationpackages/kit-bg/src/states/jotai/atoms/packages/kit/src/states/jotai/contexts/[name]/atoms.tsIMPORTANT: These are the ONLY two atom patterns used in the project. Do not create custom atom patterns or use plain Jotai atoms outside of these established structures.
// packages/kit-bg/src/states/jotai/atoms/myFeature.ts
import { globalAtom } from '../utils';
import { EAtomNames } from '../atomNames';
export const myFeatureAtom = globalAtom<MyFeatureState>({
name: EAtomNames.myFeature,
initialValue: { /* initial state */ },
persist: true, // if persistence needed
});
// packages/kit/src/states/jotai/contexts/myFeature/atoms.ts
import { createJotaiContext } from '../../utils';
const { contextAtom, useContextAtom } = createJotaiContext();
export const myFeatureDataAtom = contextAtom<MyData | null>(null);
// Export hook for components
export { useContextAtom };
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import { myFeatureAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms';
function MyComponent() {
// Read and write
const [value, setValue] = useAtom(myFeatureAtom);
// Read only
const value = useAtomValue(myFeatureAtom);
// Write only
const setValue = useSetAtom(myFeatureAtom);
}