RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/crunl/Xingyu-Frontend

Cursor rule

.cursor/rules/reduxing.mdc

[object Object]

Cursor rules

Quality

45/100

Scores the file, not the repository.

Length

138 words

3 headings · 1 code blocks

Repository

0

— · pushed 377 days ago

Last changed

3 days ago

First indexed 3 days ago.
crunl/Xingyu-Frontend/.cursor/rules/reduxing.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: false
5---
6# 状态管理规范
7 
8## 1. Redux Toolkit 使用规范
9```typescript
10// features/auth/authStore.ts
11import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
12 
13// 异步 action
14export const fetchUserInfo = createAsyncThunk(
15 'user/fetchUserInfo',
16 async (userId: string) => {
17 const response = await fetchUserById(userId);
18 return response.data;
19 }
20);
21 
22// slice 定义
23const userSlice = createSlice({
24 name: 'user',
25 initialState: {
26 userInfo: null,
27 loading: false,
28 error: null,
29 },
30 reducers: {
31 clearUser: (state) => {
32 state.userInfo = null;
33 },
34 },
35 extraReducers: (builder) => {
36 builder
37 .addCase(fetchUserInfo.pending, (state) => {
38 state.loading = true;
39 })
40 .addCase(fetchUserInfo.fulfilled, (state, action) => {
41 state.loading = false;
42 state.userInfo = action.payload;
43 })
44 .addCase(fetchUserInfo.rejected, (state, action) => {
45 state.loading = false;
46 state.error = action.error.message;
47 });
48 },
49});
50 
51export const { clearUser } = userSlice.actions;
52export default userSlice.reducer;
53```
54 
55## 2. 状态管理最佳实践
56- 使用 `createSlice` 定义状态和 reducers
57- 异步操作使用 `createAsyncThunk`
58- 避免在组件中直接修改状态
59- 使用 `useSelector` 获取状态,`useDispatch` 派发 action
60 

Sections

  • 状态管理规范
  • 1. Redux Toolkit 使用规范
  • 2. 状态管理最佳实践

Stack — with the evidence

typescript

(1.00)

vite

(1.00)

eslint

(1.00)

node

(0.70)

react

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

github-actions

(0.60)

vercel

(0.60)

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
crunl
Language
—
License
—
Archived
no

All configs in this repo

Also in crunl/Xingyu-Frontend

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
crunl/Xingyu-Frontend.cursor/rules/api.mdc · 0Cursor rulestypescriptvite+8api45/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/comments.mdc · 0Cursor rulestypescriptvite+8securityapidocs46/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/componenting.mdc · 0Cursor rulestypescriptvite+8no sections45/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/naming.mdc · 0Cursor rulestypescriptvite+8archtypesapiui58/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/project.mdc · 0Cursor rulestypescriptvite+8no sections50/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/routing.mdc · 0Cursor rulestypescriptvite+8no sections53/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/styling.mdc · 0Cursor rulestypescriptvite+8archui54/1003 days ago
crunl/Xingyu-Frontend.cursor/rules/typescript.mdc · 0Cursor rulestypescriptvite+8typesdocs42/1003 days ago
Diff against .cursor/rules/api.mdc Diff against .cursor/rules/comments.mdc Diff against .cursor/rules/componenting.mdc Diff against .cursor/rules/naming.mdc Diff against .cursor/rules/project.mdc Diff against .cursor/rules/routing.mdc Diff against .cursor/rules/styling.mdc Diff against .cursor/rules/typescript.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack